decimal
decimal copied to clipboard
Arbitrary-precision fixed-point decimal numbers in Go
when save to mongodb with mgo, decimal.Decimal is empty. Is it bson serialize needed?
Cannot create a Decimal from +Inf
``` Testing: github.com/shopspring/decimal Testing: "/builddir/build/BUILD/decimal-1.1.0/_build/src/github.com/shopspring/decimal" + GOPATH=/builddir/build/BUILD/decimal-1.1.0/_build:/usr/share/gocode + go test -buildmode pie -compiler gc -ldflags '-extldflags '\''-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '\''' --- FAIL: TestFloat64 (0.00s) decimal_test.go:297: 0.00000000000000000100000000000000000000000000000000012341234 should be represented inexactly...
Long time listener, first time caller. I couldn't see any documentation on this, so I thought I'd ask: is there a reason that support for JSON serialization to a specified...
if i have file that contains Q16.16 number represented as uint32 how can i use this library for such case? Also does read this from file as uint32 and use...
I was wondering whether it would make sense, similar to Zero, to define var's like One, Two .. Ten, Hundred, Thousand, and perhaps Half, Quarter ... ? Make it easier...
the string `$8,112.61` breaks for me. I am hesitant to open this given that the `$` is already *not* supported. Should `FromString` variants handle string formatters? Maybe strip out `$`/`,`...
Dear All, I have written some functions that I believe are useful to add to the decimal master. Can somebody help me to get them there? Geert
```golang func TestNegZero(t *testing.T) { negativeZero := math.Copysign(0, -1) value := decimal.NewFromFloat(negativeZero) if value.Sign() > -1 { t.Errorf("Expected a negative sign but got %v", value.Sign()) } actual, _ := value.Float64()...
The current implementation breaks expected behaviour of sql scanner when scanning into a pointer. Scanning a `NULL` column into a pointer `d *Decimal` returns an error instead of the pointer...