Comments (1)
Because as far as we're concerned those amounts are not invalid.
You will often find examples of price amounts with more digits than what the currency specifies. An extra digit for tax calculation reasons (EU VAT), or for unit prices of items sold in large quantities, or for certain product categories (gasoline in the US).
Other CLDR-powered NumberFormatters (PHP, Java) also allow parsing such amounts without errors. So if you have a need to be more strict, then that kind of check is best implemented on top of the existing logic (e.g. after Parse() returns).
from currency.
Related Issues (20)
- Tag v1.0.0 HOT 1
- IsValid() should consider empty values valid
- Handle minor amount values HOT 3
- Document some more features HOT 9
- Amount should implement driver.Valuer and sql.Scanner interfaces
- The calculation precision (16) is sometimes not enough
- Formatter uses wrong symbol after locale fallback HOT 3
- NoSql Support HOT 3
- allow more uses of the zero value HOT 3
- support banker's rounding HOT 2
- Optimized version of roundingContext is wrong HOT 2
- unsupported type []unit8 with pq driver HOT 2
- Introduce currency.ForCountryCode() for getting a country's currency HOT 4
- Number() gives exponent formatting sometimes HOT 3
- Add support for the accounting formatter style (negative amounts in parenthesis) HOT 4
- Negative currency converted to `BigInt` becomes positive HOT 3
- Why does this code work? What is the purpose of Locale? HOT 2
- Rework locale data filtering (-modern is going away)
- Support `pq` driver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from currency.