|
@@ -276,6 +276,7 @@ export function DownloadExcel(data, filename) {
|
|
|
// return parseInt(f * m, 10) / m;
|
|
|
// }
|
|
|
export function formatNum(value, n) {
|
|
|
+<<<<<<< HEAD
|
|
|
console.log(value, n,'====')
|
|
|
var f = Math.round(value*Math.pow(10,n))/Math.pow(10,n);
|
|
|
var s = f.toString();
|
|
@@ -286,6 +287,13 @@ export function formatNum(value, n) {
|
|
|
}else{
|
|
|
s += '.';
|
|
|
}
|
|
|
+=======
|
|
|
+ var f = Math.round(value*Math.pow(10,n))/Math.pow(10,n);
|
|
|
+ var s = f.toString();
|
|
|
+ var rs = s.indexOf('.');
|
|
|
+ if(rs < 0) {
|
|
|
+ s += '.';
|
|
|
+>>>>>>> 63ce8c0319c1ba9f742fea6e6fe1bab17931e17c
|
|
|
}
|
|
|
for(var i = s.length - s.indexOf('.'); i <= n; i++){
|
|
|
s += "0";
|