x/text/currency: add support for arbitrary-precision currency amounts #15274
There are two ways to apply an amount: currency.Unit.Amount and directly with the currency.Formatter implementations. Both ways have a type validation TODO pending.
How should the error handling be implemented? Is panic appropriate? As an alternative Unit.Amount could return an error or an ok boolean and the Formatter could print fmt style error strings.
More extensive number handling for numbers in general is being implemented in a separate package. Error handling should be handled in this separate package. big.* should be supported there too.
However, as long as there are no API changes I'm find with adding a provisional implementation to support the big.*. See format_test.go:TestFormatting to add test cases for these. Keep in mind this would be temporary code. If you need it now it will make sense to add it though.
Also note that for really proper and correct currency handling, we will need a decimal floating point type.