This commit is contained in:
Tom Groves 2018-05-15 10:34:27 +01:00
parent c0b4895881
commit af7ae958d5
3 changed files with 3 additions and 3 deletions

@ -310,7 +310,7 @@ function hashq(str/*:string*/)/*:string*/ {
}
return o;
}
function rnd(val/*:number*/, d/*:number*/)/*:string*/ { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); }
function rnd(val/*:number*/, d/*:number*/)/*:string*/ { return ""+(+(Math.round(val + "e+" + d) + "e-" + d)); }
function dec(val/*:number*/, d/*:number*/)/*:number*/ {
if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
return 0;

@ -506,7 +506,7 @@ function hashq(str/*:string*/)/*:string*/ {
}
return o;
}
function rnd(val/*:number*/, d/*:number*/)/*:string*/ { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); }
function rnd(val/*:number*/, d/*:number*/)/*:string*/ { return ""+(+(Math.round(val + "e+" + d) + "e-" + d)); }
function dec(val/*:number*/, d/*:number*/)/*:number*/ {
if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
return 0;

2
xlsx.js generated

@ -481,7 +481,7 @@ function hashq(str) {
}
return o;
}
function rnd(val, d) { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); }
function rnd(val, d) { return ""+(+(Math.round(val + "e+" + d) + "e-" + d)); }
function dec(val, d) {
if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
return 0;