aboutsummaryrefslogtreecommitdiff
path: root/lib/data_types
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-01-21 09:01:25 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-01-21 10:24:22 +0100
commitd01f0ceae62116443c501889f88c0f8782ec6250 (patch)
treeb174983ed272e5a1137dbfe4cce3abd0918d2042 /lib/data_types
parent778f4e0b649663b6ef838b2ee71b1df363b961d5 (diff)
Prevent number for beiing escaped as string when generating the csv filemain
Diffstat (limited to 'lib/data_types')
-rw-r--r--lib/data_types/value.ml7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/data_types/value.ml b/lib/data_types/value.ml
index 6bf85ae..5c54369 100644
--- a/lib/data_types/value.ml
+++ b/lib/data_types/value.ml
@@ -1,6 +1,6 @@
external show_float : string -> float -> string = "show_float"
-let match_date = Re.Str.regexp {|[0-9]+/[0-9]+/[0-9]+|}
+let match_number = Re.Str.regexp {|[0-9]+$|}
type t =
| Null
@@ -19,5 +19,6 @@ let to_string locale = function
| false -> c
| true ->
(* If the string is a date, do not escape it *)
- if Re.Str.string_match match_date c 0 then c
- else String.concat "" [ "=\""; c; "\"" ])
+ if Re.Str.string_match match_number c 0 then
+ String.concat "" [ "=\""; c; "\"" ]
+ else c)