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

Feature request: Allow underscores in amounts #61

Open
qjcg opened this issue Nov 23, 2024 · 3 comments
Open

Feature request: Allow underscores in amounts #61

qjcg opened this issue Nov 23, 2024 · 3 comments

Comments

@qjcg
Copy link

qjcg commented Nov 23, 2024

Allowing amounts to include underscores would be very helpful for readability.

2024-11-22 Joe's Very Expensive Coffee
  Expenses:Restaurants:Coffee   1000000     ; status quo, amount can be difficult to read at a glance 
  Assets:Bank:Checking

2024-11-23 Joe's Very Expensive Coffee
  Expenses:Restaurants:Coffee   1_000_000   ; amount is more readable
  Assets:Bank:Checking

See:

@wakatara
Copy link

@qjcg Supporting this would make everything incompatible with regular ledger files and other programs. I'd argue against this. Perhaps supporting commas or decimals as per international money standards might make sense but this would break the ledger plain-text format, I believe.

@qjcg
Copy link
Author

qjcg commented Nov 24, 2024

@qjcg Supporting this would make everything incompatible with regular ledger files and other programs. I'd argue against this. Perhaps supporting commas or decimals as per international money standards might make sense but this would break the ledger plain-text format, I believe.

@wakatara I'm with you on wanting to keep the format compatible with other ledger-related tools. To support that, commands like ledger print could remove underscores (or provide a flag that does).

On the pro side here is all of the prior art across programming languages (e.g. Go, Rust, Python, many others linked above) and markup languages (e.g. TOML). It's a very popular approach where numeric values need to be maximally readable at a glance in text-based formats.

@howeyc
Copy link
Owner

howeyc commented Nov 25, 2024

This is an interesting idea.

I took a look at the original ledger, and it doesn't look like it's supported, and it doesn't appear anyone has asked for it.

hledger did have an issue opened, but the devs decided against it.

Not sure what I want to do. I'll think about it.

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