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(kit): Number has broken zero padding when decimalSeparator equals to non-default value #586

Merged
merged 1 commit into from
Oct 12, 2023
Merged

fix(kit): Number has broken zero padding when decimalSeparator equals to non-default value #586

merged 1 commit into from
Oct 12, 2023

Conversation

hpieterse
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows Conventional Commits
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Code style update
  • Build or CI related changes
  • Documentation content changes

What is the current behavior?

const options = maskitoNumberOptionsGenerator({
    decimalSeparator: ',',
    thousandSeparator: '.',
    decimalPseudoSeparators: ['.', ','],
    precision: 2,
    decimalZeroPadding: true,
});

const largeValue = '1000000';

// will return a value without zero padding
maskitoTransform(largeValue, options); // '1.000.000'

What is the new behavior?

const options = maskitoNumberOptionsGenerator({
    decimalSeparator: ',',
    thousandSeparator: '.',
    decimalPseudoSeparators: ['.', ','],
    precision: 2,
    decimalZeroPadding: true,
});

const largeValue = '1000000';

// will return a value with zero padding
maskitoTransform(largeValue, options); // '1.000.000,00'

Does this PR introduce a breaking change?

  • Yes
  • No

@nsbarsukov nsbarsukov self-requested a review October 12, 2023 07:36
@nsbarsukov nsbarsukov changed the title fix(kit): use configured decimal seperator when padding zeros fix(kit): Number has broken zero padding when decimalSeparator equals to non-default value Oct 12, 2023
Copy link
Member

@nsbarsukov nsbarsukov left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! ❤️

@nsbarsukov nsbarsukov merged commit 7241761 into taiga-family:main Oct 12, 2023
23 checks passed
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