Re: float default formatting

2005-03-26 Thread Bernard Delmée
Are you trying to do currency? There are better ways, using the locale methods. No, just dumping some data structures and I'd rather not check every item's type and format floats explicitly. I was hoping the sprintf mask float's __str__ probably uses was somehow exposed and could be altered. -- ht

Re: float default formatting

2005-03-26 Thread Tim Roberts
Bernard Delmée <[EMAIL PROTECTED]> wrote: > >Is there a simple way to modify the default sprintf mask >used for floats ? (eg something like sys.float_mask = '%.2f') >I've tried assigning to float.__dict__[ '__str__' ], but >that's apparently not allowed. No. The mask string is passed relatively d

float default formatting

2005-03-24 Thread Bernard Delmée
Is there a simple way to modify the default sprintf mask used for floats ? (eg something like sys.float_mask = '%.2f') I've tried assigning to float.__dict__[ '__str__' ], but that's apparently not allowed. -- http://mail.python.org/mailman/listinfo/python-list