dustin/go-humanize

Incorrect year length

chrisgilbert opened this issue · 1 comments

const (

I just noticed when scanning the docs that a year here is a multiple of 12 months, and since each month is considered 30 days, that gives a 360 days year. I assume this is not intended, though it seems financial calculations sometimes use a 360 day year. I guess it should be 365.25 days.

I suppose it wouldn’t likely be noticed unless you were doing multi year calculations though.

dustin commented

Given the rounding, it's not super likely to be noticeable, but a demonstration in a unit test would justify a fix.