开发中...

This commit is contained in:
injoyai
2024-10-25 16:11:48 +08:00
parent a12b6cafe9
commit 9827688853
6 changed files with 42 additions and 16 deletions

View File

@@ -48,6 +48,9 @@ func FloatUnitString(f float64) string {
for i := 0; f > 1e4 && i < len(m); f /= 1e4 {
unit = m[i]
}
if unit == "" {
return conv.String(f)
}
return fmt.Sprintf("%0.2f%s", f, unit)
}