dustin/go-humanize

Handle MinInt64 correctly

stefanludwig opened this issue · 2 comments

Great library!

Comma(math.MinInt64) is not handled properly. Please add the following before the sign := "" line:

        // we need to handle MinInt64 separately
        if v == math.MinInt64 {
                return "-9,223,372,036,854,775,808"
        }

Thanks for the report. I've run into this class of problem in C code years ago and just almost had a test case for it. I fixed the test case bug.

Sweet! Thanks.