diff options
| author | DivisionByZero <[email protected]> | 2023-12-30 13:19:29 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-30 12:19:29 +0000 |
| commit | 87e0490978ae4fd2a7ca9aab550a475add513ef6 (patch) | |
| tree | 84922009f0d5eb8e998c2bb72698018e049eba07 /src/modules/location | |
| parent | c10899b638ae36c09833d4de8d79dd3958d58e5a (diff) | |
| download | faker-87e0490978ae4fd2a7ca9aab550a475add513ef6.tar.xz faker-87e0490978ae4fd2a7ca9aab550a475add513ef6.zip | |
refactor(number): deprecate precision in favor of multipleOf in float (#2564)
Diffstat (limited to 'src/modules/location')
| -rw-r--r-- | src/modules/location/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 6d15741d..b06af49e 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -579,7 +579,7 @@ export class LocationModule extends ModuleBase { const { max = 90, min = legacyMin, precision = legacyPrecision } = options; - return this.faker.number.float({ min, max, precision: 10 ** -precision }); + return this.faker.number.float({ min, max, multipleOf: 10 ** -precision }); } /** @@ -732,7 +732,7 @@ export class LocationModule extends ModuleBase { const { max = 180, min = legacyMin, precision = legacyPrecision } = options; - return this.faker.number.float({ max, min, precision: 10 ** -precision }); + return this.faker.number.float({ max, min, multipleOf: 10 ** -precision }); } /** @@ -1207,7 +1207,7 @@ export class LocationModule extends ModuleBase { const angleRadians = this.faker.number.float({ max: 2 * Math.PI, - precision: 0.00001, + multipleOf: 0.00001, }); // in ° radians const radiusMetric = isMetric ? radius : radius * 1.60934; // in km @@ -1215,7 +1215,7 @@ export class LocationModule extends ModuleBase { const distanceInKm = this.faker.number.float({ max: radiusMetric, - precision: 0.001, + multipleOf: 0.001, }) * errorCorrection; // in km /** |
