Fixing a minor logical error.
This commit is contained in:
parent
ac87437588
commit
562d4f4f58
|
@ -76,10 +76,11 @@ decimal parse_decimal(const char *&p) noexcept {
|
|||
}
|
||||
while (is_integer(*p)) {
|
||||
if (answer.num_digits + 1 < max_digits) {
|
||||
answer.digits[answer.num_digits++] = uint8_t(*p - '0');
|
||||
answer.digits[answer.num_digits] = uint8_t(*p - '0');
|
||||
} else {
|
||||
answer.truncated = true;
|
||||
}
|
||||
answer.num_digits++;
|
||||
++p;
|
||||
}
|
||||
const char *first_after_period{};
|
||||
|
@ -95,10 +96,11 @@ decimal parse_decimal(const char *&p) noexcept {
|
|||
}
|
||||
while (is_integer(*p)) {
|
||||
if (answer.num_digits + 1 < max_digits) {
|
||||
answer.digits[answer.num_digits++] = uint8_t(*p - '0');
|
||||
answer.digits[answer.num_digits] = uint8_t(*p - '0');
|
||||
} else {
|
||||
answer.truncated = true;
|
||||
}
|
||||
answer.num_digits++;
|
||||
++p;
|
||||
}
|
||||
answer.decimal_point = int32_t(first_after_period - p);
|
||||
|
|
Loading…
Reference in New Issue