Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
finesse
pykat
Commits
35d22f32
Commit
35d22f32
authored
Dec 05, 2013
by
Andreas Freise
Browse files
fixing a slly error in SIfloat.
parent
079b10b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/SIfloat.py
View file @
35d22f32
...
...
@@ -9,24 +9,24 @@ def SIfloat(value):
return
convertToFloat
(
value
)
def
convertToFloat
(
value
):
__prefix
=
{
'y'
:
1
e-24
,
# yocto
'z'
:
1
e-21
,
# zepto
'a'
:
1
e-18
,
# atto
'f'
:
1
e-15
,
# femto
'p'
:
1
e-12
,
# pico
'n'
:
1
e-9
,
# nano
'u'
:
1
e-6
,
# micro
'm'
:
1
e-3
,
# mili
'c'
:
1
e-2
,
# centi
'd'
:
1
e-1
,
# deci
'k'
:
1
e3
,
# kilo
'M'
:
1
e6
,
# mega
'G'
:
1
e9
,
# giga
'T'
:
1
e12
,
# tera
'P'
:
1
e15
,
# peta
'E'
:
1
e18
,
# exa
'Z'
:
1
e21
,
# zetta
'Y'
:
1
e24
,
# 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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment