progressbar icon indicating copy to clipboard operation
progressbar copied to clipboard

Format numbers with separators

Open bitlux opened this issue 5 months ago • 4 comments

Would you accept a PR that added an Option that formatted numbers with a separator, e.g. OptionSeparator("_") would format numbers as 1_048_576?

bitlux avatar Sep 12 '25 00:09 bitlux

Yep

schollz avatar Sep 12 '25 15:09 schollz

@bitlux this change looks like a good-first-issue, could you please share the requirement in more detail, I would like to get my hands dirty on it.

goyal-aman avatar Nov 22 '25 12:11 goyal-aman

@goyal-aman Hello! As a warning, I made an attempt to implement this, but I never sent a PR because I had earlier sent PR #223, and that hasn't been looked at. You can see my progress on this issue at https://github.com/schollz/progressbar/compare/main...bitlux:progressbar:separator

The idea is to add a new Option function that takes a string to use a separator. If that option is passed, then instead of printing, say, "0/1048576", it would print "0/1,048,576" or whatever the separator is. Let me know if you have any more questions.

bitlux avatar Nov 23 '25 04:11 bitlux

@bitlux thanks for heads up - implementation looks nice!

goyal-aman avatar Nov 23 '25 07:11 goyal-aman