btcpayserver/BTCPayServer/wwwroot/crowdfund/helpers/math.js

22 lines
515 B
JavaScript
Raw Normal View History

2023-05-30 10:34:48 +02:00
String.prototype.noExponents= function(){
const data = String(this).split(/[eE]/);
2019-01-09 12:55:02 +01:00
if(data.length== 1) return data[0];
var z= '', sign= this<0? '-':'',
str= data[0].replace('.', ''),
mag= Number(data[1])+ 1;
if(mag<0){
z= sign + '0.';
while(mag++) z += '0';
return z + str.replace(/^\-/,'');
}
mag -= str.length;
while(mag--) z += '0';
return str + z;
2023-05-30 10:34:48 +02:00
}
Number.prototype.noExponents= function(){
return String(this).noExponents();
2019-01-09 12:55:02 +01:00
};