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/w/e/WebPutty-HEAD/libs/babel/support.py   WebPutty(Download)
from babel.core import Locale
from babel.dates import format_date, format_datetime, format_time, LC_TIME
from babel.numbers import format_number, format_decimal, format_currency, \
                          format_percent, format_scientific, LC_NUMERIC
from babel.util import set, UTC
        :see: `babel.numbers.format_decimal`
        """
        return format_decimal(number, format, locale=self.locale)
 
    def currency(self, number, currency):

src/k/a/kay-HEAD/kay/lib/babel/support.py   kay(Download)
from babel.dates import format_date, format_datetime, format_time, \
                        format_timedelta, LC_TIME
from babel.numbers import format_number, format_decimal, format_currency, \
                          format_percent, format_scientific, LC_NUMERIC
from babel.util import set, UTC
        :see: `babel.numbers.format_decimal`
        """
        return format_decimal(number, format, locale=self.locale)
 
    def currency(self, number, currency):

src/b/a/babel-HEAD/babel/support.py   babel(Download)
from babel.dates import format_date, format_datetime, format_time, \
                        format_timedelta, LC_TIME
from babel.numbers import format_number, format_decimal, format_currency, \
                          format_percent, format_scientific, LC_NUMERIC
from babel.util import set, UTC
        :see: `babel.numbers.format_decimal`
        """
        return format_decimal(number, format, locale=self.locale)
 
    def currency(self, number, currency):

src/p/r/proofofexistence-HEAD/babel/support.py   proofofexistence(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/b/a/Babel-CLDR-HEAD/babel/support.py   Babel-CLDR(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.util import UTC
        :see: `babel.numbers.format_decimal`
        """
        return format_decimal(number, format, locale=self.locale)
 
    def currency(self, number, currency):

src/m/e/mediadrop-HEAD/mediadrop/lib/filesize.py   mediadrop(Download)
 
from babel import Locale
from babel.numbers import format_decimal
 
 
def format_filesize(size, locale='en'):
    locale = Locale.parse(locale)
    value, unit = human_readable_size(size)
    return format_decimal(value, format=u'#,##0.#', locale=locale) + u'\xa0' + unit
 

src/r/o/rollyourown_commerce-1.0.1/rollyourown/commerce/utils/formatting.py   rollyourown_commerce(Download)
                                                            self.currency)
            decimal_sym = self.locale.number_symbols.get('decimal', ".")
            value = babel.numbers.format_decimal(value, "#,##0.00",
                                                        locale=self.locale)
 

src/r/o/Roll-Your-Own-HEAD/rollyourown/commerce/utils/formatting.py   Roll-Your-Own(Download)
                                                            self.currency)
            decimal_sym = self.locale.number_symbols.get('decimal', ".")
            value = babel.numbers.format_decimal(value, "#,##0.00",
                                                        locale=self.locale)
 

src/n/a/nagare-0.4.1/nagare/i18n.py   nagare(Download)
        u'12.345'
        """
        return numbers.format_decimal(number, format, self)
 
    def format_currency(self, number, currency, format=None):

src/k/i/kitsune-HEAD/kitsune/sumo/helpers.py   kitsune(Download)
from babel import localedata
from babel.dates import format_date, format_time, format_datetime
from babel.numbers import format_decimal
from jingo import register, env
from jinja2.utils import Markup
    if n is None:
        return ''
    return format_decimal(n, locale=_babel_locale(_contextual_locale(context)))
 
 

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