Module kiwi.datatypes
Data type converters with locale and currency support.
Provides routines for converting data to and from strings. Simple
example:
>>> from kiwi.datatypes import converter
>>> converter.from_string(int, '1,234')
'1234'
>>> converter.from_string(float, '1,234')
'1234.0'
>>> converter.to_string(currency, currency('10.5'))
'$10.50'
Function Summary |
|
_ (m)
kiwi |
|
filter_locale (value,
monetary)
Removes the locale specific data from the value string. |
|
get_localeconv()
|
|
lformat (format,
value)
Like locale.format but with grouping enabled |
filter_locale(value,
monetary=False)
Removes the locale specific data from the value string. Currently we
only remove the thousands separator and convert the decimal point. The
returned value of this function can safely be passed to float()
-
- Parameters:
value -
value to convert
monetary -
if we should treat it as monetary data or not
- Returns:
-
the value without locale specific data
|
lformat(format,
value)
Like locale.format but with grouping enabled
-
|