# Functions
AmountFromFloat64 takes a float64 value and converts it into an amount object.
AmountFromHumanString removes any excess decimal places, commas, or other symbols so that we end up with a simple string that can be parsed.
AmountFromString takes the provided string and tries to convert it into an amount object.
MakeAmount is a helper to make it a little easier to build a new Amount instance.
MakeFormatter prepares a new formatter with the two main configuration options, decimal and thousands separators.
MakePercentage will make a new Percentage instance with the provided value and exponent.
Max checks if the value is less than or equal to the provided amount or percentage.
Min checks if the value is greater than or equal to the provided amount or percentage.
NewAmount provides a pointer to an Amount instance.
NewPercentage provides a new pointer to a Percentage value.
PercentageFromAmount provides the percentage value of the amount ensuring it is correctly scaled.
PercentageFromString builds a percentage value from a provided string.
# Constants
e.g.
NumeralArabic can be used to output numbers using the Arabic numeral system.
NumeralWestern defines the Western Arabic numeral system, and is the default.
# Variables
AmountZero is a convenience variable for testing against zero amounts.
ErrIsZero indicates that the value is zero when it should not be.
Negative validates the value is less than or equal to zero.
NotZero validates that the value is not zero.
PercentageZero is a convenience variable for testing against zero percentages.
Positive validates the that value is greater than or equal to zero.
# Structs
Amount represents a quantity with decimal places that will not suffer rounding errors like traditional floats.
Formatter is used to define how an amount should be formatted alongside a unit if necessary.
Percentage wraps around the regular Amount handler to provide support for percentage values, especially useful for tax rates.
ThresholdRule is a validator for Amounts and Percentages.
# Type aliases
NumeralSystem describes how to output numbers.