|
@@ -307,7 +307,10 @@ function reverse(num){
|
|
|
|
|
|
function formatMoney(s, dot = ',', decimal = 2) {
|
|
|
if (!s) return '0.00';
|
|
|
- s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(decimal === 0 ? 2 : decimal) + '';
|
|
|
+ s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(decimal) + '';
|
|
|
+ if (!decimal) {
|
|
|
+ s += '.';
|
|
|
+ }
|
|
|
let l = s.split('.')[0].split('').reverse(),
|
|
|
r = s.split('.')[1].slice(0, decimal);
|
|
|
let t = '';
|