Feb-22-2022, 12:25 PM
It looks like i18n/l10n stuff. You can use locale to delocalize language-specific strings.
import locale # get current systems locale # and set it for the current running interpreter locale.setlocale(locale.LC_ALL, locale.getlocale()) # input str from somewhere value_str = "1.200.500,33" # delocalize the value # converting the resulting str into a float value_float = float(locale.delocalize(value)) # format a float to a str with the current currency value_currency = locale.currency(value_float)The package babel has additional helper functions: https://babel.pocoo.org/en/latest/numbers.html
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!