qfw
This commit is contained in:
@@ -67,7 +67,7 @@ const formatMoney = function (s: string) {
|
||||
var noNegative = true;
|
||||
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||
if (parseFloat(s) < 0) {
|
||||
s = Math.abs(s).toFixed(2) + "";
|
||||
s = Math.abs(s) + "";
|
||||
noNegative = false;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,12 @@ const formatMoney = function (s: string) {
|
||||
t += l[i] + ""; //加上空格
|
||||
}
|
||||
}
|
||||
return (noNegative ? "" : "-") + t.split("").reverse().join("") + "." + r;
|
||||
if(r){
|
||||
return (noNegative ? "" : "-") + t.split("").reverse().join("") + "." + r;
|
||||
|
||||
}else{
|
||||
return (noNegative ? "" : "-") + t.split("").reverse().join("")
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
|
||||
Reference in New Issue
Block a user