From d01f0ceae62116443c501889f88c0f8782ec6250 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 21 Jan 2026 09:01:25 +0100 Subject: Prevent number for beiing escaped as string when generating the csv file --- lib/data_types/value.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib') 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) -- cgit v1.2.3