mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Added fmtFloat def
This commit is contained in:
parent
57ca74ce34
commit
f4adc657bd
1 changed files with 5 additions and 0 deletions
|
@ -114,6 +114,11 @@ def fmtPercentage(float_value, point=1):
|
||||||
fmt = '%' + "0.%(b)df" % {'b': point}
|
fmt = '%' + "0.%(b)df" % {'b': point}
|
||||||
return locale.format_string(fmt, float_value) + "%"
|
return locale.format_string(fmt, float_value) + "%"
|
||||||
|
|
||||||
|
def fmtFloat(float_value, point=1):
|
||||||
|
"Return a string representing a float with decimal separator according to current locale"
|
||||||
|
fmt = '%' + "0.%(b)df" % {'b': point}
|
||||||
|
return locale.format_string(fmt, float_value)
|
||||||
|
|
||||||
# HTML
|
# HTML
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue