Commit 35d22f32 authored by Andreas Freise's avatar Andreas Freise
Browse files

fixing a slly error in SIfloat.

parent 079b10b9
......@@ -9,24 +9,24 @@ def SIfloat(value):
return convertToFloat(value)
def convertToFloat(value):
__prefix = {'y': 1e-24, # yocto
'z': 1e-21, # zepto
'a': 1e-18, # atto
'f': 1e-15, # femto
'p': 1e-12, # pico
'n': 1e-9, # nano
'u': 1e-6, # micro
'm': 1e-3, # mili
'c': 1e-2, # centi
'd': 1e-1, # deci
'k': 1e3, # kilo
'M': 1e6, # mega
'G': 1e9, # giga
'T': 1e12, # tera
'P': 1e15, # peta
'E': 1e18, # exa
'Z': 1e21, # zetta
'Y': 1e24, # yotta
__prefix = {'y': 'e-24', # yocto
'z': 'e-21', # zepto
'a': 'e-18', # atto
'f': 'e-15', # femto
'p': 'e-12', # pico
'n': 'e-9', # nano
'u': 'e-6', # micro
'm': 'e-3', # mili
'c': 'e-2', # centi
'd': 'e-1', # deci
'k': 'e3', # kilo
'M': 'e6', # mega
'G': 'e9', # giga
'T': 'e12', # tera
'P': 'e15', # peta
'E': 'e18', # exa
'Z': 'e21', # zetta
'Y': 'e24', # yotta
}
value = str(value)
for i, j in __prefix.iteritems():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment