(Sep-04-2017, 10:48 AM)DeaD_EyE Wrote:Quote:If you just want to output a string for dollar, i18n is overkill.
In this case the normal formatting method is the easiest way to solve the problem quickly.
fmt = '$ {:.2f}' value = 1.1337 final_string = fmt.format(value) print(final_string) # or shorter print('$ {:.2f}'.format(value)) # since python 3.6 with format strings print(f'{value:.2f}')The curly braces are replaced by the variable. The text after the colon is the format specifier.
Here you get a good overview: https://pyformat.info/
Schöne Grüße aus Deutschland :-)
Maybe i flight this year back to Zibo to my girlfriend :-)
Thanks so much for your detailed explanation! Best wishes!