comparison babel/numbers.py @ 39:3b314a78015d

Move function for determining the system default locale to `babel.core`, and make it available as a class method on `Locale`.
author cmlenz
date Wed, 06 Jun 2007 11:02:24 +0000
parents 48cf004aa357
children fa8a27b80eb4
comparison
equal deleted inserted replaced
38:a22b7656e9ae 39:3b314a78015d
22 """ 22 """
23 # TODO: percent and scientific formatting 23 # TODO: percent and scientific formatting
24 24
25 import re 25 import re
26 26
27 from babel.core import Locale 27 from babel.core import getdefault, Locale
28 from babel.util import default_locale
29 28
30 __all__ = ['format_number', 'format_decimal', 'format_currency', 29 __all__ = ['format_number', 'format_decimal', 'format_currency',
31 'format_percent', 'format_scientific', 'parse_number', 30 'format_percent', 'format_scientific', 'parse_number',
32 'parse_decimal', 'NumberFormatError'] 31 'parse_decimal', 'NumberFormatError']
33 __docformat__ = 'restructuredtext en' 32 __docformat__ = 'restructuredtext en'
34 33
35 LC_NUMERIC = default_locale('LC_NUMERIC') 34 LC_NUMERIC = getdefault('LC_NUMERIC')
36 35
37 def get_decimal_symbol(locale=LC_NUMERIC): 36 def get_decimal_symbol(locale=LC_NUMERIC):
38 """Return the symbol used by the locale to separate decimal fractions. 37 """Return the symbol used by the locale to separate decimal fractions.
39 38
40 >>> get_decimal_symbol('en_US') 39 >>> get_decimal_symbol('en_US')
Copyright (C) 2012-2017 Edgewall Software