Forum Archive

Display a number in engineering notation

donnieh

Before I go wild and write an algorithm to convert a number to engineering notation, is anyone aware of a simple way to achieve this?

How can I convert, for example, 1,234 into 1.234e+3
or
0.00123 into 1.23e-3?

Phuket2

@donnieh , I am hopeless on this stuff, but I think

f = 0.00123
print '{0:e}'.format(f)
ccc

http://stackoverflow.com/questions/12311148/print-number-in-engineering-format