• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A Nix-friendly SQLite-enhanced fork of Flitter, a speedrunning split timer for Unix-style terminals


Commit MetaInfo

Revision2fffe4624a7a0ee6d17ffc197e77a17fa3608ccf (tree)
Zeit2020-08-20 10:08:26
AutorAlex Morson <alexmorson@btin...>
CommiterAlex Morson

Log Message

Fix millisecond padding bug

Milliseconds were being zero padded in the wrong direction, meaning that
a time of eg. 24.017 would be displayed as 24.170

Ändern Zusammenfassung

Diff

--- a/src/duration.ml
+++ b/src/duration.ml
@@ -24,11 +24,6 @@ let left_pad_zeros size str =
2424 left_pad_zeros_char_list str size
2525 |> String.of_char_list
2626
27-let right_pad_zeros size str =
28- left_pad_zeros_char_list str size
29- |> List.rev
30- |> String.of_char_list
31-
3227 let of_string str =
3328 match Re.exec_opt compiled_re str with
3429 | None -> None
@@ -41,7 +36,7 @@ let of_string str =
4136 let hours = group_strs.(2) |> to_int_default in
4237 let minutes = group_strs.(3) |> to_int_default in
4338 let seconds = group_strs.(4) |> to_int_default in
44- let millis = group_strs.(5) |> right_pad_zeros 3 |> to_int_default in
39+ let millis = group_strs.(5) |> left_pad_zeros 3 |> to_int_default in
4540
4641 Some (
4742 day * days +