numbr icon indicating copy to clipboard operation
numbr copied to clipboard

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

Open gustavotrott opened this issue 5 months ago • 7 comments

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)

gustavotrott avatar Mar 24 '24 20:03 gustavotrott

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?

antonmedv avatar Mar 25 '24 06:03 antonmedv

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

damjanuzelac avatar Mar 25 '24 08:03 damjanuzelac

Like:

decimal separator = ,

antonmedv avatar Mar 25 '24 11:03 antonmedv

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!

gustavotrott avatar Mar 25 '24 11:03 gustavotrott

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

---
decimal separator = ,
---

Here is a strange number 100,005

antonmedv avatar Mar 26 '24 10:03 antonmedv

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.

gustavotrott avatar Apr 03 '24 12:04 gustavotrott

Yeap. I’m thinking about hiding config.

antonmedv avatar Apr 03 '24 12:04 antonmedv