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

Add Support for Multiple Number Formats (Comma or Point as Decimal Separator) #37

Open
gustavotrott opened this issue Mar 24, 2024 · 7 comments

Comments

@gustavotrott
Copy link

I'm writing to request enhanced support for various number formats in Numbr, particularly for the use of the comma as either a decimal separator or a thousands separator. Currently, the platform seems to predominantly support the format where a comma serves one specific role (as a thousands separator), which aligns with the practices of several regions. However, a significant portion of the global population uses a format where the comma acts as a decimal separator, leading to potential confusion and data interpretation errors.

I propose the introduction of functionality that allows users to choose their preferred number formatting style. This could involve toggling between:

  • Point as a decimal separator (and comma for thousands separator)
  • Comma as a decimal separator (and point for thousands separator)
@antonmedv
Copy link
Owner

Yeap. True. I also was thinking about it before starting the coding. I decided to go with a dot at decimal point. Using both, dot and comma. Make thinks very unclear without specifying a locale.

For example: 100,005

what is this number?

@damjanuzelac
Copy link

This has been bugging me a lot, especially when I copy paste numbers from other places. They paste as wrong format and then it's manual labor to correct them all.

If I may suggest two solutions:

  • add a setting that sets the preferred format and save it locally (local storage)
  • add an optional syntax like locale=FR for instance, that can be written at the first line of the document

@antonmedv
Copy link
Owner

Like:

decimal separator = ,

@gustavotrott
Copy link
Author

This has been bugging me a lot, especially when I copy paste numbers from other places. They paste as wrong format and then it's manual labor to correct them all.

If I may suggest two solutions:

  • add a setting that sets the preferred format and save it locally (local storage)
  • add an optional syntax like locale=FR for instance, that can be written at the first line of the document

Maybe local storage could save your favorite format.
But when we "Share document" the current format should be included!
So an URL parameter would be the best solution in my opinion, because it doesn't clutter the document with settings.

But if an URL param is not an option, decimal separator = , would solve the issue!

@antonmedv
Copy link
Owner

I'm thinking to add this in doc itself. In params section:

---
decimal separator = ,
---

Here is a strange number 100,005

@gustavotrott
Copy link
Author

I'm thinking to add this in doc itself. In params section:

---
decimal separator = ,
---

Here is a strange number 100,005

Just thinking about adding config lines directly in the document itself. It's cool for control, but might clutter things up for folks sharing docs, especially if their audience isn't tech-savvy or fluent in English.

How about to auto-hide those config lines when a document is opened? You could add a "Show Configs" button for anyone wanting to edit them. Keeps things clean for most users while still flexible for those who need it.

@antonmedv
Copy link
Owner

Yeap. I’m thinking about hiding config.

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

No branches or pull requests

3 participants