Skip to content

Commit

Permalink
Fix millis padding bug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexozer committed Nov 15, 2024
1 parent 2f5fdf0 commit dfdd772
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/split_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ mod duration_format {
{
let num = match mat {
Some(d) => {
let num = u64::from_str(d.as_str()).map_err(E::custom)?;
let padded = format!("{:0<3}", num);
u64::from_str(&padded).unwrap()
let mut num_str = d.as_str().to_string();
while num_str.len() < 3 {
num_str.push('0');
}
u64::from_str(&num_str).unwrap()
}
None => 0,
};
Expand Down

0 comments on commit dfdd772

Please sign in to comment.