Skip to content

Commit

Permalink
A typo error #3 fixed: now checking minus sign of value, rather than …
Browse files Browse the repository at this point in the history
…its length. Also replaced charAt with brackets.
  • Loading branch information
dev-lab committed Jun 17, 2024
1 parent 30fd90a commit 5a5e402
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tmbus.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function p10(n, e) {
var i = parseInt(n);
if(n !== i) return isNaN(i) ? n : n * Math.pow(10, e);
}
var t = "" + n, b = (s ? s.charAt(0) == "-" : n < 0) ? 1 : 0, l = ln(t);
var t = "" + n, b = (s ? t[0] == "-" : n < 0) ? 1 : 0, l = ln(t);
if(e > 0) t += sNc("0", e);
else {
e += l - b;
Expand Down Expand Up @@ -588,7 +588,7 @@ function rv(v) {
if(v.f) t = v.f(t);
m = Array.isArray(t);
if(m) t = ha2si(t);
if(s) t = m ? (t.charAt(0) == "-" ? t.slice(1) : ("-" + t)): -t;
if(s) t = m ? (t[0] == "-" ? t.slice(1) : ("-" + t)): -t;
if(v.e) t = p10(t, v.e);
}
v.value = t;
Expand Down
Loading

0 comments on commit 5a5e402

Please sign in to comment.