Library recommendation -- money calculations, more accurate handling of floats

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • currency

    Currency handling for Go.

    I have the change done in a branch, I just need 4.0.0 to be released, but it's been a long wait (I opened https://github.com/bojanz/currency/issues/1 in May of 2020).

  • decimal

    Arbitrary-precision fixed-point decimal numbers in Go

    We personally use https://github.com/shopspring/decimal and it works well.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • apd

    Arbitrary-precision decimals for Go

    The best decimal package is still cockroachdb/apd. I wrap it in bojanz/currency for money handling.

  • decimal

    A high-performance, arbitrary-precision, floating-point decimal library. (by ericlagergren)

    I am still tracking ericlagergren/decimal as an alternative to apd, due to its better performance, but it's still seeing very low maintainer activity (still waiting on a v4 for go mod compat).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts