Monetary amount
A monetary amount is a quantity of money represented by a numeric value together with a currency.
Learn Go with Pocket-Sized Projects
An amount is a monetary value whose numeric representation is interpreted with a currency and subject to supported precision constraints.
- How it is used
- Models the input and output values of a currency-conversion command-line tool.
- How deep it goes
- Implements construction, fixed-precision representation, conversion, validation, and testing, while bounding supported values.
- Examples
- Uses 19.8875 Canadian dollars to demonstrate excess precision and 34.98 USD to EUR as a conversion test.
- What you can do after
- Build it from scratch as a Go amount type with precision checks and conversion-result validation.
Read how Learn Go with Pocket-Sized Projects explains monetary amount →
Building User-Friendly DSLs
A DSL type whose values represent monetary amounts.
- How it is used
- Enables rental-price attributes and expressions to represent dollar values distinctly from percentages and date ranges.
- How deep it goes
- Works through bottom-up expression typing on ASTs, including references, binary operations, parentheses, and an untyped fallback.
- Examples
- Uses a discounted rental-price expression with amount references, a percentage discount, of, and subtraction.
- What you can do after
- Evaluate/understand whether rental-price expressions compute to an amount and why invalid type combinations require errors.
Read how Building User-Friendly DSLs explains monetary amount →
Also covered in
- 100 Java Mistakes and How to Avoid Them
- Fight Fraud with Machine LearningIn early access (MEAP)
- Django in Action
What to know first
- float64Float64 is a 64-bit floating-point numeric type, commonly represented by the IEEE 754 binary64 format.
- floating-point arithmeticFloating-point arithmetic is numerical computation using finite-precision representations of real numbers, which can introduce rounding and range errors.
Related concepts
- account balanceincludes · An account balance is the recorded amount of money or funds associated with a financial account.
- Stringerimplements · fmt.Stringer is a Go standard-library interface implemented by a type with a parameterless String method returning a textual representation.
- BigDecimalused by · BigDecimal is a Java standard-library class representing immutable, arbitrary-precision signed decimal values.
- currencyhas part · Currency is a system and unit of money used to express monetary value, facilitate exchange, and denominate financial amounts.
- fraud detectionused by · Fraud detection is the process of identifying transactions, activities, or other events suspected of involving intentional deception or unauthorized gain.
Questions about monetary amount
What is monetary amount?
A monetary amount is a quantity of money represented by a numeric value together with a currency.
Which Manning books explain monetary amount?
Learn Go with Pocket-Sized Projects and Building User-Friendly DSLs.
What should I know before learning monetary amount?
Manning books that teach monetary amount usually introduce float64 and floating-point arithmetic first.
What kinds of monetary amount are there?
Kinds of monetary amount include account balance.
What are the parts of monetary amount?
Monetary amount includes currency.
What is monetary amount also called?
Monetary amount is also called Money.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

