qfw
This commit is contained in:
parent
b12826594e
commit
23f2e2ff67
@ -106,7 +106,7 @@ const _sfc_main = defineComponent({
|
|||||||
var noNegative = true;
|
var noNegative = true;
|
||||||
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||||
if (parseFloat(s) < 0) {
|
if (parseFloat(s) < 0) {
|
||||||
s = Math.abs(s).toFixed(2) + "";
|
s = Math.abs(s) + "";
|
||||||
noNegative = false;
|
noNegative = false;
|
||||||
}
|
}
|
||||||
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
|
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
|
||||||
@ -118,7 +118,11 @@ const _sfc_main = defineComponent({
|
|||||||
t += l[i] + "";
|
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, () => {
|
watch(() => props.type, () => {
|
||||||
type.value = props.type;
|
type.value = props.type;
|
||||||
|
@ -11202,7 +11202,7 @@ const _sfc_main$1v = defineComponent({
|
|||||||
var noNegative = true;
|
var noNegative = true;
|
||||||
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||||
if (parseFloat(s) < 0) {
|
if (parseFloat(s) < 0) {
|
||||||
s = Math.abs(s).toFixed(2) + "";
|
s = Math.abs(s) + "";
|
||||||
noNegative = false;
|
noNegative = false;
|
||||||
}
|
}
|
||||||
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
|
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
|
||||||
@ -11214,7 +11214,11 @@ const _sfc_main$1v = defineComponent({
|
|||||||
t += l[i] + "";
|
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, () => {
|
watch(() => props.type, () => {
|
||||||
type4.value = props.type;
|
type4.value = props.type;
|
||||||
|
@ -67,7 +67,7 @@ const formatMoney = function (s: string) {
|
|||||||
var noNegative = true;
|
var noNegative = true;
|
||||||
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||||
if (parseFloat(s) < 0) {
|
if (parseFloat(s) < 0) {
|
||||||
s = Math.abs(s).toFixed(2) + "";
|
s = Math.abs(s) + "";
|
||||||
noNegative = false;
|
noNegative = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,12 @@ const formatMoney = function (s: string) {
|
|||||||
t += l[i] + ""; //加上空格
|
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(
|
watch(
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user