AJChapman / formatting

Format strings type-safely with combinators
BSD 3-Clause "New" or "Revised" License
164 stars 39 forks source link

Feature request - precision control on time diff formatting #63

Open ddssff opened 4 years ago

ddssff commented 4 years ago

I'd like to be able to increase the time precision, so we would see things like "36 hours", "90 minutes", etc.

iustin commented 1 year ago

I second this, or at least, make it more obvious that the value is not precise.

Right now, the output is the same for both of these:

λ> format (diff False) (24*3600)
"a day"
λ> format (diff False) (47*3600)
"a day"

Which is confusing. I'm not sure about whether it should be multi-unit (e.g. a day and 23 hours), or approximate (almost two days), but I think saying 47:59:59 is "a day" is factually wrong. Similar for "a year".

Any thoughts on what would best, or at least acceptable here?