comparison babel/numbers.py @ 235:d0cd235ede46

Upgraded to CLDR 1.5 and improved timezone formatting.
author cmlenz
date Wed, 01 Aug 2007 12:32:20 +0000
parents ce3ad60145db
children d462423feeea
comparison
equal deleted inserted replaced
234:541b6d630575 235:d0cd235ede46
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'
Copyright (C) 2012-2017 Edgewall Software