-
Notifications
You must be signed in to change notification settings - Fork 17
feat(formatNumber): render numbers with spaces instead of comas #778
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
feat(formatNumber): render numbers with spaces instead of comas #778
Conversation
66f0bea to
b251244
Compare
| box-sizing: border-box; | ||
|
|
||
| // Make all numbers in the app monospace | ||
| font-variant-numeric: tabular-nums; |
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.
I deleted font for TopShards table. It's different from font throughout the app. Instead I set monospace numbers everywhere in the app
| it('should convert to size', () => { | ||
| expect(formatBytes({value: 100_000, size: 'b'})).toBe('100,000 B'); | ||
| expect(formatBytes({value: 100_000_000_000_000, size: 'gb'})).toBe('100,000 GB'); | ||
| expect(formatBytes({value: 100_000, size: 'b'})).toBe('100 000 B'); |
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.
Fixed broken tests
| import {Lang, i18n} from './i18n'; | ||
|
|
||
| // Set space delimeter for all locales possible in project | ||
| Object.values(Lang).forEach((value) => { | ||
| if (numeral.locales[value]) { | ||
| numeral.locales[value].delimiters.thousands = ' '; | ||
| } | ||
| }); |
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 configured numeral almost correctly, but it seems you deleted "," in format string. In format "," is delimiter sign, not delimiter itself, so no delimiter was applied.
I made more simple delimiter override, so it should work and no so complex for future support
7e94038 to
8127004
Compare
8127004 to
23e0ef8
Compare
|
Cool thanks for the improvements 🔥 |

No description provided.