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

Fixed issue with dot separator when decimalScale is set to zero #375 #376

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

sergei97k
Copy link
Contributor

@sergei97k sergei97k commented Nov 30, 2019

Fixes #375

@sergei97k sergei97k changed the title Fixed issue with dot separator when decimalScale is set to zero Fixed issue with dot separator when decimalScale is set to zero #375 Nov 30, 2019
@@ -615,7 +615,8 @@ class NumberFormat extends React.Component {

/** Check for any allowed decimal separator is added in the numeric format and replace it with decimal separator */
if (!format && start === end && allowedDecimalSeparators.indexOf(value[selectionStart]) !== -1 ) {
return value.substr(0, selectionStart) + decimalSeparator + value.substr(selectionStart + 1, value.length);
const separator = this.props.decimalScale === 0 ? '' : decimalSeparator;
Copy link
Owner

Choose a reason for hiding this comment

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

Destruct decimalScale on top of this function.

@s-yadav
Copy link
Owner

s-yadav commented Feb 20, 2020

Thanks, the changes look good. And sorry for the very late reply.
There is just a small change. I will merge this and make that change.

@s-yadav s-yadav merged commit c327ebe into s-yadav:master Feb 20, 2020
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.

Incorrect dot handler for input with decimalScale=0
2 participants