Fix floating points < 1
This commit is contained in:
parent
4f72351ee9
commit
f9e512c593
@ -129,7 +129,7 @@ func (n Numeric) String() string {
|
|||||||
|
|
||||||
exp = -exp
|
exp = -exp
|
||||||
for length <= exp {
|
for length <= exp {
|
||||||
bytes = append(bytes, byte('0'))
|
bytes = append([]byte{byte('0')}, bytes...)
|
||||||
length++
|
length++
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ func (n Numeric) MarshalJSON() ([]byte, error) {
|
|||||||
|
|
||||||
exp = -exp
|
exp = -exp
|
||||||
for length <= exp {
|
for length <= exp {
|
||||||
bytes = append(bytes, byte('0'))
|
bytes = append([]byte{byte('0')}, bytes...)
|
||||||
length++
|
length++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user