{"repo":"Rhymond/go-money","free":true,"listed":false,"github":"https://github.com/Rhymond/go-money","clone":"git clone https://github.com/Rhymond/go-money.git","description":"Go implementation of Fowler's Money pattern","language":"Go","stars":1911,"topics":["fowler-money-pattern","currency","money","money-library","formatter"],"license":"MIT","category":"dev-tools","readme_excerpt":"Money GoMoney provides ability to work with monetary value using a currency's smallest unit. This package provides basic and precise Money operations such as rounding, splitting and allocating. Monetary values should not be stored as floats due to small rounding differences. Quick start - Get the package: Features Provides a Money struct which stores information about an Money amount value and its currency. Provides a struct which encapsulates all information about a monetary unit. Represents monetary values as integers, in cents. This avoids floating point rounding errors. Represents currency as instances providing a high level of flexibility. Usage - Initialization Initialize Money by using smallest unit value (e.g 100 represents 1 pound). Use ISO 4217 Currency Code to set money Currency. Note that constants are also provided for all ISO 4217 currency codes. Or initialize Money using the direct amount. Comparison - Go-money provides base compare operations like: Equals GreaterThan GreaterThanOrEqual LessThan LessThanOrEqual Compare Comparisons must be made between the same currency units. Asserts - IsZero IsNegative IsPositive Zero value To assert if Money value is equal to zero use IsZero() Positive value To assert if Money value is more than zero use IsPositive() Negative value To assert if Money value is less than zero use IsNegative() Operations - Add Subtract Multiply Absolute Negative Comparisons must be made between the same currency units. Addition Additions can be ","default_branch":null,"files":null,"tree":[],"storefront":"/r/Rhymond","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Rhymond/go-money/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."}