konova/konova/utils/general.py
mipel 4c045618e6 Eco Account deduction
* adds deductable_surface to EcoAccount model to provide an easy way to change the deductable amount from an account -> depends on external funding e.g. with AktionBlau or similar
* adds overview of deducted and deductable volume to detail view
* adds check to eco account model, so the deductable_surface can never be larger than the total amount of after_state surface sum
* adds german formating for python logic based number formating
* adds/updates translations
2021-09-17 13:33:51 +02:00

22 lines
527 B
Python

"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 17.09.21
"""
def format_german_float(num) -> str:
""" Writes a float into a string based on german float notation
10000.000 --> "10.000,00"
Args:
num (float): The number
Returns:
num (str): The number as german Gleitkommazahl
"""
return format(num, "0,.2f").replace(",", "X").replace(".", ",").replace("X", ".")