Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit f942cf8

Browse files
committed
fix number.AsString() method
1 parent ef933b1 commit f942cf8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

model/number.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (n Number) Precision() int8 {
3636

3737
// AsString gives a string representation
3838
func (n Number) AsString() string {
39-
return strconv.FormatFloat(n.AsFloat(), 'f', int(n.Precision()), 64)
39+
return fmt.Sprintf(fmt.Sprintf("%%.%df", n.Precision()), n.AsFloat())
4040
}
4141

4242
// AsRatio returns an integer numerator and denominator

0 commit comments

Comments
 (0)