From 36367beb40b69d66ba866be31878097eed70b6be Mon Sep 17 00:00:00 2001 From: A404M Date: Sun, 23 Feb 2025 22:36:54 +0330 Subject: add more support for types --- src/utils/string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/utils/string.c') diff --git a/src/utils/string.c b/src/utils/string.c index 17e27cd..16e9f9b 100644 --- a/src/utils/string.c +++ b/src/utils/string.c @@ -47,12 +47,12 @@ f128 numberToFloat(char *str_begin, char *str_end, bool *success) { c = *str_begin++; } if (c >= '0' && c <= '9') { - if (!isPastPoint) { - left *= 10; - left += c - '0'; - } else { + if (isPastPoint) { right += c - '0'; right /= 10; + } else { + left *= 10; + left += c - '0'; } } else if (c == '.' && !isPastPoint) { isPastPoint = true; -- cgit v1.2.3