From f4adc657bd13f0b59d0ae3b4a838eba25b09a64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Susanna=20Bj=C3=B6rverud?= Date: Wed, 25 Mar 2009 11:20:42 +0100 Subject: [PATCH] Added fmtFloat def --- anki/utils.py | 5 +++++ 1 file changed, 5 insertions(+) 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 ##############################################################################