hledger icon indicating copy to clipboard operation
hledger copied to clipboard

Underscore as thousands separator

Open baryluk opened this issue 4 years ago • 7 comments
trafficstars

commodity 1_000.00 PLN

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

baryluk avatar Feb 22 '21 18:02 baryluk

@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 ?

simonmichael avatar Mar 13 '21 14:03 simonmichael

@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?

adept avatar Mar 14 '21 22:03 adept

@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.

baryluk avatar Mar 17 '21 21:03 baryluk

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

Xitian9 avatar May 03 '21 05:05 Xitian9

@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.

ShrykeWindgrace avatar Sep 09 '21 12:09 ShrykeWindgrace

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.

simonmichael avatar Mar 01 '22 01:03 simonmichael