Message239336
actually, I'm not sure whether formatting Decimals gives correct output under all conditions (correctly rounded yes, but maybe not formatted correctly?).
compare:
>>> format(float('1.481e-6'),'.3g')
'1.48e-06'
>>> format(Decimal('1.481e-6'),'.3g')
'0.00000148'
>>> format(float('1.481e-7'),'.3g')
'1.48e-07'
>>> format(Decimal('1.481e-7'),'.3g')
'1.48e-7'
So with the 'g' specifier the switch between floating point and scientific notation seems to be broken.
Also note the slightly different formatting of the exponent: the leading zero is missing for all specifiers, i.e. 'g', 'G', 'e', 'E'.
Are these bugs ? |
|
Date |
User |
Action |
Args |
2015-03-26 15:09:10 | wolma | set | recipients:
+ wolma, rhettinger, mark.dickinson, scoder, eric.smith, ezio.melotti, skrah, martin.panter, serhiy.storchaka, tuomas.suutari |
2015-03-26 15:09:10 | wolma | set | messageid: <1427382550.36.0.00707014467092.issue23602@psf.upfronthosting.co.za> |
2015-03-26 15:09:10 | wolma | link | issue23602 messages |
2015-03-26 15:09:09 | wolma | create | |
|