ticker icon indicating copy to clipboard operation
ticker copied to clipboard

Adding thousands separators

Open wavenator opened this issue 3 years ago • 8 comments

The current version shows longs numbers in a non human readable notation where long numbers are presented without thousands separators.

7453823

vs

7,453,823

A quick solution and easy solution is available - just format the printed numbers with an available library of your choice.

wavenator avatar Dec 06 '21 09:12 wavenator

And how to do this in Windows?

zohozer avatar Dec 28 '21 11:12 zohozer

WDYM? The same solution would work for any OS

wavenator avatar Dec 31 '21 15:12 wavenator

"A quick solution and easy solution is available - just format the printed numbers with an available library of your choice."

I can't find that solution you are claiming that exists!

Happy New Year!

zohozer avatar Dec 31 '21 21:12 zohozer

https://stackoverflow.com/questions/13020308/how-to-fmt-printf-an-integer-with-thousands-comma/46811454 This stackoverflow post is full of examples. I would recommend using https://github.com/dustin/go-humanize

wavenator avatar Jan 06 '22 08:01 wavenator

Thanks for the suggestion! I've seen this request a few times so I'll add it to the roadmap.

go-humanize or something similar along with commas will likely be needed to compensate for the additional characters.

achannarasappa avatar Jan 17 '22 13:01 achannarasappa

I would be willing to try to tackle this problem if you are looking for some help.

yodigi7 avatar Jun 22 '23 17:06 yodigi7

Please make the separator character user configurable. Remember that different cultures have different ways of doing this.

clauseggers avatar Aug 15 '23 16:08 clauseggers

Adding this shouldn't be too difficult but the wrinkle is that each value would take up more room due to the commas so there should be some testing done around the edge cases there + how this interacts with the scale suffix. The problem is also partially addressed by the scale suffix

@yodigi7 a PR would be welcome if you're interested in having a look.

@clauseggers agreed this should be configurable

achannarasappa avatar Aug 20 '23 14:08 achannarasappa