{"repo":"shopspring/decimal","free":true,"listed":false,"github":"https://github.com/shopspring/decimal","clone":"git clone https://github.com/shopspring/decimal.git","description":"Arbitrary-precision fixed-point decimal numbers in Go","language":"Go","stars":7469,"topics":["go","decimals","precision","money","bignumber","golang"],"license":null,"category":"databases-storage","readme_excerpt":"decimal Arbitrary-precision fixed-point decimal numbers in go. Note: Decimal library can \"only\" represent numbers with a maximum of 2^31 digits after the decimal point. Features The zero-value is 0, and is safe to use without initialization Addition, subtraction, multiplication with no loss of precision Division with specified precision Database/sql serialization/deserialization JSON and XML serialization/deserialization Install Run go get github.com/shopspring/decimal Requirements Decimal library requires Go version =1.10 Documentation http://godoc.org/github.com/shopspring/decimal Usage Alternative libraries When working with decimal numbers, you might face problems this library is not perfectly suited for. Fortunately, thanks to the wonderful community we have a dozen other libraries that you can choose from. Explore other alternatives to find the one that best fits your needs :) cockroachdb/apd - arbitrary precision, mutable and rich API similar to big.Int , more performant than this library alpacahq/alpacadecimal - high performance, low precision (12 digits), fully compatible API with this library govalues/decimal - high performance, zero-allocation, low precision (19 digits) greatcloak/decimal - fork focusing on billing and e-commerce web application related use cases, includes out-of-the-box BSON marshaling support FAQ Why don't you just use float64? Because float64 (or any binary floating point type, actually) can't represent numbers such as 0.1 exactly. Consider this","default_branch":null,"files":null,"tree":[],"storefront":"/r/shopspring","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/shopspring/decimal/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}