cockroachdb / apd

Arbitrary-precision decimals for Go
https://pkg.go.dev/github.com/cockroachdb/apd/v2
Apache License 2.0
664 stars 36 forks source link

format: do not output 0's after decimals for coeff < -2000 #130

Closed otan closed 1 year ago

otan commented 1 year ago

In Cockroach, the minimum supported coefficient for 0 is -2000. To avoid the memory overload that occurs when we try format a large 0 coefficient like 0E-10000, we amend the fix made in ffd11b1d1ea290d5ebedb620e2a59e8b62897fb2 to only output trailing zeroes up to -2000.