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

Fix value prop usage in NumericFormat #64

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Fix value prop usage in NumericFormat #64

merged 1 commit into from
Jan 22, 2024

Conversation

oliviera9
Copy link
Contributor

The usage of + sign returns the numerical representation of an object.
With some strings, this introduces some unwanted rounding.

For example:

const val = "2812.4283046805994"
console.info(+val)
# 2812.4283046805995

Plus, NumericFormat expects value to be of type string, so it's not necessary to cast into number.

This PR just revises how value is passed to NumericFormat.

@oliviera9 oliviera9 requested a review from envin3 January 22, 2024 18:30
Copy link
Collaborator

@envin3 envin3 left a comment

Choose a reason for hiding this comment

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

LGTM!

@envin3 envin3 merged commit 0062490 into master Jan 22, 2024
4 checks passed
@envin3 envin3 deleted the fix/max-rounding branch January 22, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants