修复四舍五入问题
This commit is contained in:
parent
574bf55ec4
commit
1c64c63ab6
@ -139,17 +139,9 @@ func (f *Format) String(v float64) string {
|
|||||||
|
|
||||||
switch f.vType {
|
switch f.vType {
|
||||||
case TYPE_NUMERIC:
|
case TYPE_NUMERIC:
|
||||||
if 0 == f.bts {
|
|
||||||
ret = strconv.FormatInt(int64(v), 10)
|
|
||||||
} else {
|
|
||||||
ret = strconv.FormatFloat(v, 'f', f.bts, 64)
|
ret = strconv.FormatFloat(v, 'f', f.bts, 64)
|
||||||
}
|
|
||||||
case TYPE_CURRENCY:
|
case TYPE_CURRENCY:
|
||||||
if 0 == f.bts {
|
|
||||||
ret = strconv.FormatInt(int64(v), 10)
|
|
||||||
} else {
|
|
||||||
ret = strconv.FormatFloat(v, 'f', f.bts, 64)
|
ret = strconv.FormatFloat(v, 'f', f.bts, 64)
|
||||||
}
|
|
||||||
case TYPE_PERCENTAGE:
|
case TYPE_PERCENTAGE:
|
||||||
if 0 == f.bts {
|
if 0 == f.bts {
|
||||||
ret = strconv.FormatInt(int64(v)*100, 10) + "%"
|
ret = strconv.FormatInt(int64(v)*100, 10) + "%"
|
||||||
|
Loading…
Reference in New Issue
Block a user