Skip to content

Commit

Permalink
Precision about integer overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Apr 19, 2020
1 parent a4c298a commit bbda5d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ echo $money->formatWith($formatter); // US$5·000.00
Money::ofMinor($integerAmount, $currencyCode);
```

This approach works perfectly with all currencies, without having to worry about the scale.
This approach works well with all currencies, without having to worry about the scale. You only have to worry about not overflowing an integer (which would throw an exception), but this is unlikely to happen unless you're dealing with huge amounts of money.

- **As a decimal**: for most other cases, storing the amount string as a decimal type is advised:

Expand Down

0 comments on commit bbda5d2

Please sign in to comment.