Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(117)  |  Call(86)  |  Derive(0)  |  Import(31)

        def format_decimal(number, format=None, locale=LC_NUMERIC):
    u"""Return the given decimal number formatted for a specific locale.

    >>> format_decimal(1.2345, locale='en_US')
    u'1.234'
    >>> format_decimal(1.2346, locale='en_US')
    u'1.235'
    >>> format_decimal(-1.2346, locale='en_US')
    u'-1.235'
    >>> format_decimal(1.2345, locale='sv_SE')
    u'1,234'
    >>> format_decimal(1.2345, locale='de')
    u'1,234'

    The appropriate thousands grouping and the decimal separator are used for
    each locale:

    >>> format_decimal(12345.5, locale='en_US')
    u'12,345.5'

    :param number: the number to format
    :param format:
    :param locale: the `Locale` object or locale identifier
    """
    locale = Locale.parse(locale)
    if not format:
        format = locale.decimal_formats.get(format)
    pattern = parse_pattern(format)
    return pattern.apply(number, locale)
        


src/a/l/AllSpeak-0.5.1/allspeak/__init__.py   AllSpeak(Download)
        """
        locale = normalize_locale(locale) or self.get_locale()
        return numbers.format_decimal(number, format=format, locale=locale)
 
    def format_currency(self, number, currency, format=None, locale=None):

src/a/p/appscale-HEAD/AppServer/lib/webapp2-2.5.2/webapp2_extras/i18n.py   appscale(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/a/p/appscale-HEAD/AppServer/lib/webapp2-2.5.1/webapp2_extras/i18n.py   appscale(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/a/p/appscale-HEAD/AppServer/lib/webapp2-2.3/webapp2_extras/i18n.py   appscale(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/b/a/Babel-1.3/babel/support.py   Babel(Download)
from babel.dates import format_date, format_datetime, format_time, \
     format_timedelta
from babel.numbers import format_number, format_decimal, format_currency, \
     format_percent, format_scientific
from babel._compat import PY2, text_type, text_to_native
        u'1.234'
        """
        return format_decimal(number, format, locale=self.locale)
 
    def currency(self, number, currency):

src/g/o/google-app-engine-HEAD/lib/webapp2-2.5.2/webapp2_extras/i18n.py   google-app-engine(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/g/o/google-app-engine-HEAD/lib/webapp2-2.5.1/webapp2_extras/i18n.py   google-app-engine(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/g/o/google-app-engine-HEAD/lib/webapp2-2.3/webapp2_extras/i18n.py   google-app-engine(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/g/o/googleappengine-python-HEAD/lib/webapp2-2.5.2/webapp2_extras/i18n.py   googleappengine-python(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

src/g/o/googleappengine-python-HEAD/lib/webapp2-2.5.1/webapp2_extras/i18n.py   googleappengine-python(Download)
            The formatted decimal number.
        """
        return numbers.format_decimal(number, format=format,
                                      locale=self.locale)
 

Previous  1 | 2 | 3 | 4 | 5 | 6 | 7  Next