Fixing web numeric conversion.

When convert got "converted" to web,
and unsigned type didn't use the >>> operator.
This leads to errors in excluding characters like commas.
This commit is contained in:
Brad Nelson
2024-05-08 20:27:27 -07:00
parent 3a125e4635
commit 0f9cac2ab4

View File

@ -323,9 +323,9 @@ function Convert(pos, n, base, ret) {
if (u8[pos] == '-'.charCodeAt(0)) { negate = -1; ++pos; --n; }
if (u8[pos] == '$'.charCodeAt(0)) { base = 16; ++pos; --n; }
for (; n; --n) {
var d = UPPER(u8[pos]) - 48;
var d = (UPPER(u8[pos]) - 48) >>> 0;
if (d > 9) {
d -= 7;
d = (d - 7) >>> 0;
if (d < 10) { return 0; }
}
if (d >= base) { return 0; }