Fixed decimal notation #500
This commit is contained in:
1 parent
92c28b092b
commit
e5b24b393e
2 files changed
+8
-2
No files matched your search
+4
-1
@@ -1379,8 +1379,11 @@ CM.Disp.Beautify = function(num, floats, forced) {
|
|||||||
return num.toString()
|
return num.toString()
|
||||||
}
|
}
|
||||||
else if (0.001 < num && num < CM.Options.ScaleCutoff) {
|
else if (0.001 < num && num < CM.Options.ScaleCutoff) {
|
||||||
answer = num.toFixed(0);
|
answer = num.toFixed(2);
|
||||||
if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl');
|
if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl');
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
if (answer[answer.length - 1] == "0" | answer[answer.length - 1] == ".") answer = answer.slice(0, -1)
|
||||||
|
}
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8
|
else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8
|
||||||
|
|||||||
+4
-1
@@ -196,8 +196,11 @@ CM.Disp.Beautify = function(num, floats, forced) {
|
|||||||
return num.toString()
|
return num.toString()
|
||||||
}
|
}
|
||||||
else if (0.001 < num && num < CM.Options.ScaleCutoff) {
|
else if (0.001 < num && num < CM.Options.ScaleCutoff) {
|
||||||
answer = num.toFixed(0);
|
answer = num.toFixed(2);
|
||||||
if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl');
|
if (CM.Options.ScaleSeparator) answer = answer.toLocaleString('nl');
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
if (answer[answer.length - 1] == "0" | answer[answer.length - 1] == ".") answer = answer.slice(0, -1)
|
||||||
|
}
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8
|
else if (CM.Options.Scale == 4 && !forced || forced == 4) { // Scientific notation, 123456789 => 1.235E+8
|
||||||
|
|||||||
Reference in new issue
Block a user