Mercurial > babel > old > babel-test
comparison babel/numbers.py @ 233:bc22f5aef216
Upgraded to CLDR 1.5 and improved timezone formatting.
author | cmlenz |
---|---|
date | Wed, 01 Aug 2007 12:32:20 +0000 |
parents | b566f483b763 |
children | 5e4b1fd6b348 |
comparison
equal
deleted
inserted
replaced
232:0e5c33776833 | 233:bc22f5aef216 |
---|---|
125 u"""Return formatted currency value. | 125 u"""Return formatted currency value. |
126 | 126 |
127 >>> format_currency(1099.98, 'USD', locale='en_US') | 127 >>> format_currency(1099.98, 'USD', locale='en_US') |
128 u'$1,099.98' | 128 u'$1,099.98' |
129 >>> format_currency(1099.98, 'USD', locale='es_CO') | 129 >>> format_currency(1099.98, 'USD', locale='es_CO') |
130 u'US$1.099,98' | 130 u'US$ 1.099,98' |
131 >>> format_currency(1099.98, 'EUR', locale='de_DE') | 131 >>> format_currency(1099.98, 'EUR', locale='de_DE') |
132 u'1.099,98 \\u20ac' | 132 u'1.099,98 \\u20ac' |
133 | 133 |
134 The pattern can also be specified explicitly: | 134 The pattern can also be specified explicitly: |
135 | 135 |
154 >>> format_percent(0.34, locale='en_US') | 154 >>> format_percent(0.34, locale='en_US') |
155 u'34%' | 155 u'34%' |
156 >>> format_percent(25.1234, locale='en_US') | 156 >>> format_percent(25.1234, locale='en_US') |
157 u'2,512%' | 157 u'2,512%' |
158 >>> format_percent(25.1234, locale='sv_SE') | 158 >>> format_percent(25.1234, locale='sv_SE') |
159 u'2\\xa0512 %' | 159 u'2\\xa0512\\xa0%' |
160 | 160 |
161 The format pattern can also be specified explicitly: | 161 The format pattern can also be specified explicitly: |
162 | 162 |
163 >>> format_percent(25.1234, u'#,##0\u2030', locale='en_US') | 163 >>> format_percent(25.1234, u'#,##0\u2030', locale='en_US') |
164 u'25,123\u2030' | 164 u'25,123\u2030' |