String formatting utility functions

Jim Jewett wrote:
I guess you could do this, but I can't see it ever actually being used that way. Do you really want to only specify that you're using commas for thousands, then find that someone has switched the locale to one where a comma is the decimal character? new_util_func(1234.56, thousands_sep=',') '1,234,56' Best to be explicit on what you're expecting. My use case for this function is one where all of the arguments are known and specified every time. Specifically it's for implementing 'n' formatting for Decimal or other numeric types. You will either know the arguments, or want to use every one of them from the locale. If you're using the locale, just call localeconv() and use every value you get back. I don't have a mix-and-match use case. Eric.
participants (1)
-
Eric Smith