diff options
| author | Eric Cheng <[email protected]> | 2024-03-01 17:23:52 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-01 23:23:52 +0100 |
| commit | 9348138893bb95faa5037c653443fbd525ce2939 (patch) | |
| tree | 8823ebdf2f7ea6e934c7e407f0f6b497dffeddba /docs | |
| parent | 8e880c15da8901eb4694273a79ea4fcd908d1c3f (diff) | |
| download | faker-9348138893bb95faa5037c653443fbd525ce2939.tar.xz faker-9348138893bb95faa5037c653443fbd525ce2939.zip | |
fix(commerce): return fractional prices (#2458)
Co-authored-by: ST-DDT <[email protected]>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/guide/upgrading_v9/2458.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/guide/upgrading_v9/2458.md b/docs/guide/upgrading_v9/2458.md new file mode 100644 index 00000000..172e7afc --- /dev/null +++ b/docs/guide/upgrading_v9/2458.md @@ -0,0 +1,15 @@ +### Prices now return more price-like values + +The `faker.commerce.price` method now produces values, that also return fractional values. + +Old price: 828.00 +New price: 828.59 + +The last digit of the price will adjusted to be more price-like: + +- 50% of the time: `9` +- 30% of the time: `5` +- 10% of the time: `0` +- 10% of the time: a random digit from `0` to `9` + +We plan to rethink this method some more in the future: [#2579](https://github.com/faker-js/faker/issues/2579) |
