simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
2.91k stars 317 forks source link

Underscore as thousands separator #1489

Open baryluk opened 3 years ago

baryluk commented 3 years ago
commodity 1_000.00 PLN

would be nice to have. At least for inputs, but also for outputs.

simonmichael commented 3 years ago

@baryluk, we researched this a little and couldn't find any country that uses this convention. Do you know who uses it, or is it just a notation you like ?

adept commented 3 years ago

@simonmichael ocaml allows underscores in numeric literals (https://caml.inria.fr/pub/docs/manual-ocaml/lex.html), so it is often used as a convenient separator in source code (let magic_number = 1_000_000). Given ocaml's pedigree, maybe it is something that exists in France?

baryluk commented 3 years ago

@baryluk, we researched this a little and couldn't find any country that uses this convention. Do you know who uses it, or is it just a notation you like ?

Just a notation I like and prefer. It is relatively country-neutral, and is cleaner than using other separators. As a person using quite a bit of D programming language, which had this feature for 15 years, I got acustomed for it. Afaik Go and C++ also now supports it.

Xitian9 commented 3 years ago

GHC has also supported this notation since 8.6.1: https://typeclasses.com/ghc/numeric-underscores

ShrykeWindgrace commented 3 years ago

@simonmichael ocaml allows underscores in numeric literals (https://caml.inria.fr/pub/docs/manual-ocaml/lex.html), so it is often used as a convenient separator in source code (let magic_number = 1_000_000). Given ocaml's pedigree, maybe it is something that exists in France?

In France - no, it does not exist here.

simonmichael commented 2 years ago

We're discussing this again in chat, but I don't think we should add it without more motivation, since every added feature has a cost. Some examples of it used for accounting/data-tracking-type things in the wild could help.

raingloom commented 1 month ago

This is the format Erste's CSV export uses.

Edit: nevermind, it was Doom Emacs showing NBSP as underscore. But that means NBSP is not handled as advertised.