Why does Python's Decimal display some simple values as expontents and how can I prevent it? -
i understand value of exponents, typically when displaying decimal values end user, it's easier layman understand normal decimal values. when perform following, i'd rather display value of decimal 50
, instead of:
>>> decimal('22679.6185') / decimal('28.349523125') / 16 decimal('5e+1')
is possible without quantizing or doing modify actual value? also, why display short value exponent , longer values in normal decimal form? product of division (irony intended)?
see: significant figures in decimal module (which admittedly tells use .quantize()). main problem must keep track of number of significant digits manually.
Comments
Post a Comment