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 problems when prefix/postfix includes decimalSeparator symbol #816

Conversation

aktanoff
Copy link
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Build or CI related changes
  • Tests related changes
  • Documentation content changes

What is the current behaviour?

Closes #703

What is the new behaviour?

Added new utility extractPrefixAndPostfix, which extracts prefix and postfix to separate variables, and extracts cleanValue without prefix and postfix.

Used it in methods, which working with decimalSeparator to avoid decimalSeparator false matching dot in prefix and postfix.

There also many things to rethink, i have 2 more ways to fix this bug:

  1. Remove prefix and postfix in first preprocessor, and add it in last postprocessor. But we still will be needed in prefix and postfix arguments inside maskitoParseNumber
  2. Add some zerowidth symbol to separate prefix and postfix, and then we will not have to pass this parameters in any method, even in maskitoParseNumber

I will add tests after basic review

@splincode splincode force-pushed the fix-prefix-and-postfix-with-decimalseparator-processing branch from 8c54ea6 to 535c0c6 Compare December 28, 2023 10:52
@nsbarsukov
Copy link
Member

Thanks for your PR!

I will try to explore your solution soon (tomorrow or after January 9th).

Actually, I don't want to expand public API of maskitoParseNumber 🤔
Maybe there is another solution ? I will investigate it and I'll be back with feedback.

@nsbarsukov nsbarsukov added the community contribution This issue was closed by a PR from the community label Jan 9, 2024
@aktanoff aktanoff force-pushed the fix-prefix-and-postfix-with-decimalseparator-processing branch from 535c0c6 to 2b2a3b1 Compare January 13, 2024 19:56
@nsbarsukov
Copy link
Member

@aktanoff Could you fix review comments, please ?

New major release is coming.
It can be cool to include this fix to new release.

@aktanoff aktanoff force-pushed the fix-prefix-and-postfix-with-decimalseparator-processing branch from 2b2a3b1 to e54d368 Compare January 17, 2024 16:05
@nsbarsukov nsbarsukov changed the title feat(kit): fixed prefix and postfix with decimalseparator processing fix(kit): fixed prefix and postfix with decimalseparator processing Jan 18, 2024
@nsbarsukov nsbarsukov changed the title fix(kit): fixed prefix and postfix with decimalseparator processing fix(kit): Number has problems when prefix/postfix includes decimalSeparator symbol Jan 18, 2024
@nsbarsukov nsbarsukov merged commit 4f1f104 into taiga-family:main Jan 18, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contribution This issue was closed by a PR from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 - Number mask from kit has problems with processing postfix with dot
2 participants