I was going to ask about that too. Or maybe "about a minute". It seems like 
there are two things going on there: humanized expression which is still 
precise "one minute and ten seconds" versus approximate humanized expression 
"about a minute". Separate functions or maybe an option?


> On Oct 2, 2014, at 2:11 AM, Michele Zaffalon <[email protected]> 
> wrote:
> 
> Why is timedelta(70) one minute but the last command timedelta(Date(2014,3,7) 
> - Date(2013,2,4))  one year and one month? Should it not be more consistent 
> to have one minute and 10 seconds in the first case? Besides, 10 seconds in 
> one minute in percentage is more than 1 month in 1 year...
> michele
> 
>> On Thu, Oct 2, 2014 at 4:14 AM, Iain Dunning <[email protected]> wrote:
>> Hi all,
>> 
>> Announcing...
>> 
>> Humanize.jl
>> https://github.com/IainNZ/Humanize.jl
>> 
>> Humanize numbers, currently:
>> * data sizes
>> * Date/datetime differences
>> 
>> This package is MIT licensed, and is based on jmoiron's humanize Python 
>> library.
>> 
>> Installation: Pkg.add("Humanize")
>> 
>> Examples:
>> 
>> julia> datasize(3000000) 
>> "3.0 MB" 
>> julia> datasize(3000000, style=:bin, format="%.3f") 
>> "2.861 MiB" 
>> julia> datasize(3000000, style=:gnu, format="%.3f") 
>> "2.861M"
>> julia> timedelta(70) 
>> "a minute" 
>> julia> timedelta(0,0,0,23,50,50) 
>> "23 hours" 
>> julia> timedelta(DateTime(2014,2,3,12,11,10) - DateTime(2013,3,7,13,1,20)) 
>> "11 months" 
>> julia> timedelta(Date(2014,3,7) - Date(2013,2,4)) 
>> "1 year, 1 month"
> 

Reply via email to