| 1 |
Numbers and Currencies |
| 2 |
====================== |
| 3 |
|
| 4 |
.. module:: babel.numbers |
| 5 |
|
| 6 |
The number module provides functionality to format numbers for different |
| 7 |
locales. This includes arbitrary numbers as well as currency. |
| 8 |
|
| 9 |
Number Formatting |
| 10 |
----------------- |
| 11 |
|
| 12 |
.. autofunction:: format_number |
| 13 |
|
| 14 |
.. autofunction:: format_decimal |
| 15 |
|
| 16 |
.. autofunction:: format_compact_decimal |
| 17 |
|
| 18 |
.. autofunction:: format_currency |
| 19 |
|
| 20 |
.. autofunction:: format_compact_currency |
| 21 |
|
| 22 |
.. autofunction:: format_percent |
| 23 |
|
| 24 |
.. autofunction:: format_scientific |
| 25 |
|
| 26 |
Number Parsing |
| 27 |
-------------- |
| 28 |
|
| 29 |
.. autofunction:: parse_number |
| 30 |
|
| 31 |
.. autofunction:: parse_decimal |
| 32 |
|
| 33 |
Exceptions |
| 34 |
---------- |
| 35 |
|
| 36 |
.. autoexception:: NumberFormatError |
| 37 |
:members: |
| 38 |
|
| 39 |
.. autoexception:: UnknownCurrencyError |
| 40 |
:members: |
| 41 |
|
| 42 |
.. autoexception:: UnknownCurrencyFormatError |
| 43 |
:members: |
| 44 |
|
| 45 |
.. autoexception:: UnsupportedNumberingSystemError |
| 46 |
:members: |
| 47 |
|
| 48 |
Data Access |
| 49 |
----------- |
| 50 |
|
| 51 |
.. autofunction:: get_decimal_symbol |
| 52 |
|
| 53 |
.. autofunction:: get_exponential_symbol |
| 54 |
|
| 55 |
.. autofunction:: get_group_symbol |
| 56 |
|
| 57 |
.. autofunction:: get_infinity_symbol |
| 58 |
|
| 59 |
.. autofunction:: get_minus_sign_symbol |
| 60 |
|
| 61 |
.. autofunction:: get_plus_sign_symbol |
| 62 |
|
| 63 |
Currency Utilities |
| 64 |
------------------ |
| 65 |
|
| 66 |
.. autofunction:: get_currency_name |
| 67 |
|
| 68 |
.. autofunction:: get_currency_precision |
| 69 |
|
| 70 |
.. autofunction:: get_currency_symbol |
| 71 |
|
| 72 |
.. autofunction:: get_currency_unit_pattern |
| 73 |
|
| 74 |
.. autofunction:: get_territory_currencies |
| 75 |
|
| 76 |
.. autofunction:: is_currency |
| 77 |
|
| 78 |
.. autofunction:: list_currencies |
| 79 |
|
| 80 |
.. autofunction:: normalize_currency |
| 81 |
|
| 82 |
.. autofunction:: validate_currency |