Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(number): deprecate precision in favor of multipleOf in float #2564

Merged

Conversation

xDivisionByZerox
Copy link
Member

@xDivisionByZerox xDivisionByZerox commented Nov 30, 2023

Description

This PR deprecated the property precision in faker.number.float. Additionally, adds the property multipleOf.

Additional information

Fixes #1596.
Extracted from #1855.

@xDivisionByZerox xDivisionByZerox added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs deprecation A deprecation was made in the PR labels Nov 30, 2023
@xDivisionByZerox xDivisionByZerox requested a review from a team November 30, 2023 18:42
@xDivisionByZerox xDivisionByZerox self-assigned this Nov 30, 2023
@xDivisionByZerox xDivisionByZerox requested a review from a team as a code owner November 30, 2023 18:42
@xDivisionByZerox xDivisionByZerox added this to the v8.x milestone Nov 30, 2023
Copy link
Member

@ST-DDT ST-DDT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like some methods still use the precision parameter.

src/modules/number/index.ts Outdated Show resolved Hide resolved
src/modules/number/index.ts Outdated Show resolved Hide resolved
src/modules/number/index.ts Show resolved Hide resolved
src/modules/number/index.ts Outdated Show resolved Hide resolved
test/modules/number.spec.ts Outdated Show resolved Hide resolved
@xDivisionByZerox xDivisionByZerox added the m: number Something is referring to the number module label Dec 10, 2023
@xDivisionByZerox xDivisionByZerox requested review from a team December 10, 2023 13:51
test/modules/number.spec.ts Outdated Show resolved Hide resolved
src/modules/number/index.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c10899b) 99.57% compared to head (b63a2b1) 99.57%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #2564   +/-   ##
=======================================
  Coverage   99.57%   99.57%           
=======================================
  Files        2807     2807           
  Lines      250379   250401   +22     
  Branches     1143     1141    -2     
=======================================
+ Hits       249313   249337   +24     
+ Misses       1038     1036    -2     
  Partials       28       28           
Files Coverage Δ
src/modules/color/index.ts 99.79% <100.00%> (ø)
src/modules/datatype/index.ts 100.00% <100.00%> (ø)
src/modules/finance/index.ts 100.00% <100.00%> (ø)
src/modules/helpers/index.ts 98.98% <ø> (-0.01%) ⬇️
src/modules/location/index.ts 99.20% <100.00%> (ø)
src/modules/number/index.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

ST-DDT
ST-DDT previously approved these changes Dec 19, 2023
@ST-DDT
Copy link
Member

ST-DDT commented Dec 28, 2023

@xDivisionByZerox There appears to be merge conflicts.

@ST-DDT ST-DDT added the needs rebase There is a merge conflict label Dec 28, 2023
@ST-DDT ST-DDT removed the needs rebase There is a merge conflict label Dec 29, 2023
@ST-DDT ST-DDT requested a review from a team December 29, 2023 13:29
@ST-DDT ST-DDT enabled auto-merge (squash) December 30, 2023 12:14
@ST-DDT ST-DDT merged commit 87e0490 into next Dec 30, 2023
20 checks passed
@ST-DDT ST-DDT deleted the refactor/number/deprecate-precision-in-favor-of-multiple-of branch December 30, 2023 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs deprecation A deprecation was made in the PR m: number Something is referring to the number module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor number.float parameter precision to fractionDigits
3 participants