From c13f650c8f2f113547fdbf080288981541dad5e2 Mon Sep 17 00:00:00 2001 From: gambas Date: Fri, 10 Aug 2018 23:37:55 +0200 Subject: [PATCH] Val() correctly reads thousand separators again. [INTERPRETER] * BUG: Val() correctly reads thousand separators again. --- main/gbx/gbx_number.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/gbx/gbx_number.c b/main/gbx/gbx_number.c index 7bf04edbf..79d44cf2e 100644 --- a/main/gbx/gbx_number.c +++ b/main/gbx/gbx_number.c @@ -84,6 +84,8 @@ static bool read_integer(int base, bool minus, int64_t *result, bool local) { if (local) { + COMMON_pos--; + if (has_string(thsep, lthsep) && (ndigit_thsep == 3 || (!first_thsep && ndigit_thsep >= 1 && ndigit_thsep <= 3))) { COMMON_pos += lthsep; @@ -91,6 +93,8 @@ static bool read_integer(int base, bool minus, int64_t *result, bool local) first_thsep = TRUE; ndigit_thsep = 0; } + else + COMMON_pos++; } if (c >= '0' && c <= '9') @@ -237,6 +241,8 @@ static bool read_float(double *result, bool local) if (local && !frac) { + COMMON_pos--; + if (has_string(thsep, lthsep) && (ndigit_thsep == 3 || (!first_thsep && ndigit_thsep >= 1 && ndigit_thsep <= 3))) { COMMON_pos += lthsep; @@ -244,6 +250,8 @@ static bool read_float(double *result, bool local) ndigit_thsep = 0; c = get_char(); } + else + COMMON_pos++; } if (!isdigit(c) || (c < 0))