Michael Bienia schrieb: > It mentions that one should use the turbogears.i18n formating functions > for formating numbers but doesn't explain how to do it.
"All have full docstrings explaining parameters and provide sophisticated control over formatting." Fire up the interactive Python console: >>> from turbogears.i18n import * >>> help(format_date) > I managed to format a decimal number with > turbogears.i18n.format.format_decimal() from my controller but how do I > do it from my template? You could bind this function to a custom template variable. See thsi doc on how to do that: http://docs.turbogears.org/1.0/stdvars#custom-additions > How do I get forms to use localized numbers? Especially when I want to > edit a database record and pass the existing data to the form. I think you would need to attach a custom validator with a 'from_python' method to the form field: http://formencode.org/Validator.html#using-validation Somebody correct me, if I'm wrong. Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

