优化金额类数据的处理,限制长度
This commit is contained in:
@@ -8,9 +8,12 @@ def handle_decimal(string):
|
||||
return ""
|
||||
string = re.sub(r'[^0-9.]', '', string)
|
||||
if "." not in string:
|
||||
return string
|
||||
front, back = string.rsplit('.', 1)
|
||||
front = front.replace(".", "")
|
||||
front = string
|
||||
back = ""
|
||||
else:
|
||||
front, back = string.rsplit('.', 1)
|
||||
front = front.replace(".", "")
|
||||
|
||||
front = front[-16:]
|
||||
if back:
|
||||
back = "." + back
|
||||
|
||||
Reference in New Issue
Block a user