This commit is contained in:
2022-12-12 10:04:13 +08:00
parent b12826594e
commit 23f2e2ff67
4 changed files with 20 additions and 7 deletions

View File

@@ -11202,7 +11202,7 @@ const _sfc_main$1v = defineComponent({
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;
}
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
@@ -11214,7 +11214,11 @@ const _sfc_main$1v = defineComponent({
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(() => props.type, () => {
type4.value = props.type;