fix(data-format): preserve values when expanding scientific notation

This commit is contained in:
yangmingshuo5577-jpg
2026-09-21 09:59:54 +08:00
committed by xuwei-fit2cloud
parent 2ce3fc71ef
commit f48d7828c9
2 changed files with 95 additions and 1 deletions
+1 -1
View File
@@ -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