diff options
author | Rutger Broekhoff | 2025-08-26 11:25:59 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2025-08-26 11:25:59 +0200 |
commit | 80e1f41596ca9955b432addbf01b913d864aa7c0 (patch) | |
tree | 4208e2ff1ea0fe7f2242654b7f130e05544582c4 | |
parent | 999300d65c44d419428f9a34e2f02c221a607698 (diff) | |
download | rdcapsis-80e1f41596ca9955b432addbf01b913d864aa7c0.tar.gz rdcapsis-80e1f41596ca9955b432addbf01b913d864aa7c0.zip |
Stricter ING decimal parsingocaml
-rw-r--r-- | lib/ingcsv.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ingcsv.ml b/lib/ingcsv.ml index edb8aaa..f9cd95e 100644 --- a/lib/ingcsv.ml +++ b/lib/ingcsv.ml | |||
@@ -9,9 +9,9 @@ module Cents = struct | |||
9 | type t = Z.t | 9 | type t = Z.t |
10 | 10 | ||
11 | let of_string s = | 11 | let of_string s = |
12 | (* TODO: consider being more bitchy here *) | 12 | let high, low = String.lsplit2_exn s ~on:',' in |
13 | String.lsplit2_exn s ~on:',' |> Tuple2.map ~f:Z.of_string | 13 | assert (String.length low = 2); |
14 | |> fun (high, low) -> Z.((high * ~$100) + low) | 14 | Z.((of_string high * ~$100) + of_string low) |
15 | end | 15 | end |
16 | 16 | ||
17 | module Transaction_type = struct | 17 | module Transaction_type = struct |