-
Notifications
You must be signed in to change notification settings - Fork 75
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(input, input-number): decimals no longer contain groupSeparators and remove leading zeros #5490
Conversation
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
* master: (32 commits) 1.0.0-next.627 build(deps): bump semver-regex and screener-storybook (#5741) build(deps): bump stylelint-config-recommended-scss from 7.0.0 to 8.0.0 (#5551) build(deps): bump parse-path and @storybook/storybook-deployer (#5692) build(deps): bump tailwindcss from 3.1.8 to 3.2.2 (#5708) ci(pr-bot): check user login for dependabot instead of actor (#5740) build(deps): bump postcss from 8.4.17 to 8.4.18 (#5508) build(deps): bump concurrently from 7.4.0 to 7.5.0 (#5550) build(deps): bump loader-utils from 1.4.0 to 1.4.1 (#5704) build(deps): bump @typescript-eslint/parser from 5.40.1 to 5.42.1 (#5707) test(value-list): Skip unstable test. (#5738) ci(pr-bot): skip assignment for dependabot PRs (#5737) chore(t9manifest): Fix newline at end of file. (#5718) fix(flow-item): Position back tooltip above (#5688) feat(popover): Escape key should close open popovers. (#5726) docs: update component READMEs (#5545) fix(value-list-item): Prevent scrolling when space is pressed on drag button (#5709) ci(output targets): move patches to postbuild to include them in CCR (#5730) 1.0.0-next.626 fix(button, fab): adjust padding on 'l' scale button to accommodate 'm' scale icon without change in height (#5659) ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
✨🔢✨✨✨🔢✨🔢🔢🔢✨✨🔢🔢🔢✨🔢🔢🔢🔢✨🔢✨
✨🔢🔢✨✨🔢✨✨🔢✨✨🔢✨✨✨✨🔢✨✨✨✨🔢✨
✨🔢✨🔢✨🔢✨✨🔢✨✨🔢✨✨✨✨🔢🔢🔢✨✨🔢✨
✨🔢✨✨🔢🔢✨✨🔢✨✨🔢✨✨✨✨🔢✨✨✨✨✨✨
✨🔢✨✨✨🔢✨🔢🔢🔢✨✨🔢🔢🔢✨🔢🔢🔢🔢✨🔢✨
✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
src/utils/locale.spec.ts
Outdated
@@ -35,7 +36,7 @@ describe("NumberStringFormat", () => { | |||
}); | |||
|
|||
locales.forEach((locale) => { | |||
it(`integers localize and delocalize in "${locale}"`, () => { | |||
it(`locale: integers localize and delocalize in "${locale}"`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could place these in a describe("locale", () => { /*...*/
block for grouping instead of updating the individual test names.
* master: (24 commits) 1.0.0-next.632 feat(pick-list, value-list): Add calciteListFilter event, filteredItems prop, filterText prop and filteredData prop. (#5681) fix(block, date-picker, list-item-group, panel, pick-list-group, popover, tip, tip-manager)!: Set default internal heading to a div. (#5728) refactor(modal): Update modal to use focus-trap module. (#5676) 1.0.0-next.631 fix(input-date-picker): restores mouse clicks on date-picker popup (#5760) build(deps): bump loader-utils from 1.4.1 to 1.4.2 (#5764) ci(product-label): fix version syntax and use os agnostic newline char (#5762) 1.0.0-next.630 ci(pr-bot): don't label dependabot PRs (#5759) build(deps): bump chromatic from 6.7.1 to 6.11.4 (#5756) fix(combobox): Wrap and break text on long items (#5672) build(deps): bump @storybook/addon-interactions from 6.5.9 to 6.5.13 (#5753) build(deps): bump type-fest from 3.1.0 to 3.2.0 (#5752) build(deps): bump @storybook/addon-a11y from 6.5.12 to 6.5.13 (#5754) build(deps): bump postcss from 8.4.18 to 8.4.19 (#5755) ci: add chromatic (#5733) build(docs): generate docs-json for afd usage (#5748) 1.0.0-next.629 fix(inline-editable): Add text-ellipsis when not editing (#5679) ...
Related Issue: #5763
Repro sample: https://codepen.io/benesri/pen/zYaZaGX
Summary
This fixes a bug caused by adding the
numberingSystem
property to components. We have to format the integers and decimals separately since we support yuuge numbers using theBigDecimal
class. This caused long decimal numbers to have group separators, which I fixed by formatting each digit individually. It also caused leading zeros in decimals to be removed, e.g.0.00123
became0.123
.I also did some small cleanup in BigDecimal like caching regex and removing duplicate code