From 439abe13a022443a1b22df65c836b9218f844d45 Mon Sep 17 00:00:00 2001 From: Ivan Bessarabov Date: Mon, 25 Sep 2023 07:13:05 +0000 Subject: [PATCH] Fixing get_type() --- tests/get_type.t | 1 + tsv2table | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/get_type.t b/tests/get_type.t index 8e494bd..970340f 100644 --- a/tests/get_type.t +++ b/tests/get_type.t @@ -25,6 +25,7 @@ my %tests = ( '1.0', '0.0', '-1.0', + '1.123', ], ); diff --git a/tsv2table b/tsv2table index 50711e1..dc06e17 100755 --- a/tsv2table +++ b/tsv2table @@ -71,7 +71,7 @@ sub get_type { if ($value =~ /^-?\d+\z/a) { return 'int'; - } elsif ($value =~ /^-?\d+\.\d\z/a) { + } elsif ($value =~ /^-?\d+\.\d+\z/a) { return 'float'; } else { return 'string';