From 79c967849257427b97a7994301c21b20fdde7c82 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Mon, 10 Apr 2023 18:48:12 +0200 Subject: [PATCH] Fix float convertion --- pyhon/parameter.py | 5 ++++- setup.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyhon/parameter.py b/pyhon/parameter.py index 0e31cd3..31dbda1 100644 --- a/pyhon/parameter.py +++ b/pyhon/parameter.py @@ -2,7 +2,10 @@ import re def str_to_float(string): - return float(string.replace(",", ".")) + try: + return int(string) + except ValueError: + return float(str(string.replace(",", "."))) class HonParameter: diff --git a/setup.py b/setup.py index 0151d1a..ad83dd0 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as f: setup( name="pyhOn", - version="0.6.1", + version="0.6.2", author="Andre Basche", description="Control hOn devices with python", long_description=long_description,