From f7d3dde05d817779817475cb81d41a63434efbf1 Mon Sep 17 00:00:00 2001 From: JGarciaCondado Date: Fri, 20 Sep 2024 14:46:20 +0200 Subject: [PATCH] [BUG] Fix command numeric conversion --- src/ageml/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ageml/utils.py b/src/ageml/utils.py index 3b542ee..f048bed 100644 --- a/src/ageml/utils.py +++ b/src/ageml/utils.py @@ -28,7 +28,11 @@ def convert(value): converted_value = False else: try: - converted_value = float(value) + # If there is . treat as float if not as int + if "." in value: + converted_value = float(value) + else: + converted_value = int(value) except ValueError: # If the value cannot be converted to a float, keep it as a string converted_value = value