Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upduration() ignores decimal elements when parsing #519
Comments
jspncr
commented
Feb 15, 2017
|
I think it is a duplicate and fixed by #465. |
|
Yes, you are correct. Sorry, I should have checked the dev version first. |
|
No problem. You will next time :) |
|
Wait, i'm an idiot. I tested The issue remains.
(lubridate_1.6.0.9009) |
|
OK I see. library(lubridate)
#>
#> Attachement du package : 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
duration("1.5 hours")
#> [1] "3600s (~1 hours)"
duration("1 hour 30 min")
#> [1] "5400s (~1.5 hours)"
duration(1.5, "hours")
#> [1] "5400s (~1.5 hours)"behind the scene when lubridate:::parse_period("1.5 hours")
#> [1] "1H 0M 0S"that is converted to duration and returns So,
Not my decision, we should wait for @vspinu advice. |
|
It's a limitation of the unit parsing mechanism. Fractional units are not recognized yet. It will be fixed on the before the next release. |