diff options
| author | Leyla Jähnig <[email protected]> | 2022-11-25 16:59:10 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-11-25 16:59:10 +0100 |
| commit | 7d4d99f00bf1e29c14346bd6a9fab33c8e7d5743 (patch) | |
| tree | 323754ca575c56ccf688539cfcca66d54c903602 /src/modules/commerce | |
| parent | 0af0fff4a410d7531368c709327ba0798a47091a (diff) | |
| download | faker-7d4d99f00bf1e29c14346bd6a9fab33c8e7d5743.tar.xz faker-7d4d99f00bf1e29c14346bd6a9fab33c8e7d5743.zip | |
feat(number): move methods to new module (#1122)
Co-authored-by: ST-DDT <[email protected]>
Co-authored-by: Eric Cheng <[email protected]>
Co-authored-by: Leyla Jähnig <[email protected]>
Co-authored-by: Shinigami92 <[email protected]>
Diffstat (limited to 'src/modules/commerce')
| -rw-r--r-- | src/modules/commerce/index.ts | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/modules/commerce/index.ts b/src/modules/commerce/index.ts index 088112c1..99515463 100644 --- a/src/modules/commerce/index.ts +++ b/src/modules/commerce/index.ts @@ -67,14 +67,10 @@ export class CommerceModule { return `${symbol}${0.0}`; } - const randValue = this.faker.datatype.number({ max: max, min: min }); + // TODO @Shinigami92 2022-11-24: https://github.com/faker-js/faker/issues/350 + const randValue = this.faker.number.int({ min, max }); - return ( - symbol + - (Math.round(randValue * Math.pow(10, dec)) / Math.pow(10, dec)).toFixed( - dec - ) - ); + return symbol + randValue.toFixed(dec); } /** |
