Commit 43dc1240 authored by iker_martin's avatar iker_martin
Browse files

Improved the detection of float numbers when creating multiple config files

parent 20e3c28b
......@@ -67,13 +67,16 @@ def convert_to_number(number):
res = None
try:
res = float(number)
if res == int(number):
res = int(number)
except ValueError:
if isinstance(number, str):
res = number
else:
print("Unable to convert to number - Not a fatal error")
if isinstance(res, float):
try:
res = int(number)
except ValueError:
print("Unable to convert float to int - Not a fatal error")
return res
def process_line(line, data):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment