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

Inconsistent use of numbers and written numbers across locales #2469

Closed
steffenz opened this issue May 7, 2021 · 1 comment
Closed

Inconsistent use of numbers and written numbers across locales #2469

steffenz opened this issue May 7, 2021 · 1 comment
Assignees

Comments

@steffenz
Copy link

@steffenz steffenz commented May 7, 2021

Hi!
When I tried to use formatDistance (or any other format function for that reason), it always seems to abbreviate numbers to "written numbers" (for example twelve instead of 12) in Norwegian. I cannot replicate the same issue in any other language I've tried, and I'm not really aware of this as a grammatical rule in the Norwegian language (Norwegian is my first language). Even so, it should be possible to at the very least to have this as an option - as it unfortunately renders the formatting part useless in my current project.

Here's a link to the locale file with the abbreviation array in question.

To make life simpler I've also made a CodeSandbox which illustrates the issue in Norwegian compared to a few other languages.

If this isn't desired behavior I can certainly look into the issue and submit a PR 😸

Thanks for developing and maintaining a great library. It save everybody a bunch of time and frustration ❤️

@tan75 tan75 self-assigned this May 7, 2021
@kossnocorp
Copy link
Member

@kossnocorp kossnocorp commented May 10, 2021

Hey! This is definitely not expected behavior. It seems that original author overdid the distance formatting, and we didn't notice it. It sounds cool to have the ability to display numbers as words, but given that other locales don't have it, adding an option that enables it would be a lot of work. So please, open a PR that will make Norweigan locale consistent with others. Thank you!

kossnocorp pushed a commit that referenced this issue Sep 17, 2021
…closes #2469)

Changed: Made Norwegian `formatDuration` consistent with other locales by using numeric representation instead of written.

Co-authored-by: Lucas Silva <lucas.silva@codeminer42.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants