Home | Trees | Index | Help |
|
---|
Package kiwi :: Module 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'
Classes | |
---|---|
BaseConverter |
Abstract converter used by all datatypes |
ConverterRegistry |
Exceptions | |
---|---|
ValidationError |
Function Summary | |
---|---|
_(m)
| |
Removes the locale specific data from the value string. | |
get_localeconv()
| |
Like locale.format but with grouping enabled |
Variable Summary | |
---|---|
ConverterRegistry |
converter = <kiwi.datatypes.ConverterRegistry instance a...
|
dict |
DATE_MASK_TABLE = {'%m': '00', '%M': '00', '%H': '00', '...
|
list |
DATE_REPLACEMENTS_WIN32 = [(<_sre.SRE_Pattern object at ...
|
int |
LOCALE_SSHORTDATE = 31 |
int |
LOCALE_STIMEFORMAT = 4099 |
tuple |
number = (<type 'int'>, <type 'float'>, <type 'long'>, <...
|
Function Details |
---|
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()
|
lformat(format, value)Like locale.format but with grouping enabled |
Variable Details |
---|
converter
|
DATE_MASK_TABLE
|
LOCALE_SSHORTDATE
|
LOCALE_STIMEFORMAT
|
number
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Oct 9 12:40:59 2006 | http://epydoc.sf.net |