mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-09 09:46:55 +08:00
fix(data-format): preserve values when expanding scientific notation
This commit is contained in:
committed by
xuwei-fit2cloud
parent
2ce3fc71ef
commit
f48d7828c9
@@ -55,7 +55,7 @@ class DataFormat:
|
||||
"""格式化浮点数,避免科学记数法"""
|
||||
if value == 0:
|
||||
return "0"
|
||||
formatted = str(Decimal(str(value)))
|
||||
formatted = format(Decimal(str(value)), 'f')
|
||||
if '.' in formatted:
|
||||
formatted = formatted.rstrip('0').rstrip('.')
|
||||
return formatted
|
||||
|
||||
Reference in New Issue
Block a user