diff --git a/anki/utils.py b/anki/utils.py index 7421c8f24..635785ff2 100644 --- a/anki/utils.py +++ b/anki/utils.py @@ -114,6 +114,11 @@ def fmtPercentage(float_value, point=1): fmt = '%' + "0.%(b)df" % {'b': point} 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 ##############################################################################