add sign and comma
This commit is contained in:
13
peaktech.py
13
peaktech.py
@@ -5,7 +5,14 @@ import binascii
|
||||
|
||||
def crap_to_number(crap):
|
||||
number_str = ""
|
||||
|
||||
if(crap[0]&0x10):
|
||||
number_str+="-"
|
||||
crap[0] &= 0xEF
|
||||
|
||||
for elem in crap:
|
||||
if(elem & 0x10 != 0):
|
||||
number_str+="."
|
||||
switch={
|
||||
0xcf:"9",
|
||||
0xef:"8",
|
||||
@@ -16,9 +23,11 @@ def crap_to_number(crap):
|
||||
0x8f:"3",
|
||||
0xad:"2",
|
||||
0x0a:"1",
|
||||
0xeb:"0"
|
||||
0xeb:"0",
|
||||
0x61:"L",
|
||||
0x00:" "
|
||||
}
|
||||
number_str+=switch.get(elem, "-")
|
||||
number_str+=switch.get(elem&0xEF, "-")
|
||||
return number_str
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user