summaryrefslogtreecommitdiff
path: root/src/utils/string.c
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-23 22:36:54 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-02-23 22:36:54 +0330
commit36367beb40b69d66ba866be31878097eed70b6be (patch)
tree3f51e60b8c4cfdbb9d4c2006d249f1504e39651f /src/utils/string.c
parentaf6a58bfad54dc9d3cb49d1efa1c90a5d094bcb1 (diff)
add more support for types
Diffstat (limited to 'src/utils/string.c')
-rw-r--r--src/utils/string.c8
1 files changed, 4 insertions, 4 deletions
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;