go-humanize icon indicating copy to clipboard operation
go-humanize copied to clipboard

How to convert decimal to million or billion formats?

Open rilysh opened this issue 3 years ago • 1 comments

I want to convert decimal numbers like 1000 to 1k, 10000 to 10k, and 100000 to 100k and so on. But I'm a little confused, how to do it? Is there any function available or implemented yet about this theory?

rilysh avatar Sep 02 '22 17:09 rilysh

That looks like https://pkg.go.dev/github.com/dustin/go-humanize#SI

dustin avatar Sep 02 '22 18:09 dustin