forked from woocommerce/woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Store API response for very large price amounts (woocommerce#49361)
* Fixed overflow when formatting price for Store API responses * Added explanation comment. * Added changelog. * Linting. * Ensure wc_format_decimal doesn't return decimal points and trims .00 * Update comment. * Removed unnecessary rounding modes. * Updated comment. * Updated comment. * Updated comment. * Updated Unit Tests. * Lint. * Fix tests. * Re-add rounding modes. * Prevented a fatal if an array is supplied to the method. This was the old behaviour, although it will produce erroneous prices, but before we let this throw a fatal we need to warn devs and track usage. * Added doing_it_wrong() for unexpected types for $value arg. * Early return, removed translation, renamed unit test method. * Added expect notice to unit test. * Add further tests to rounding modes. * Renamed $mock_formatter. This is not a mock. * Fixed tests and added provider for types. * Linting.
- Loading branch information
Showing
3 changed files
with
85 additions
and
19 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
plugins/woocommerce/changelog/fix-overflow_for_huge_price_values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fixed a bug that would cause incorrect pricing at checkout for very large amounts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters