1
0
mirror of https://github.com/bspeice/dtparse synced 2025-07-01 05:46:14 -04:00

Handle fractional minutes correctly

This commit is contained in:
Bradlee Speice
2018-06-08 00:06:37 -04:00
parent 921b449c1c
commit 71f8cda588
2 changed files with 7 additions and 11 deletions

View File

@ -1269,8 +1269,9 @@ impl Parser {
let minute = value.floor().to_i64().unwrap() as i32;
let mut second = None;
let sec_remainder = value % *ONE;
let sec_remainder = value - value.floor();
if sec_remainder != *ZERO {
println!("{}", *SIXTY * sec_remainder);
second = Some((*SIXTY * sec_remainder).floor().to_i64().unwrap() as i32);
}