qfw
This commit is contained in:
@@ -114,9 +114,9 @@ const onBlur = (event: Event) => {
|
||||
onNumberBlur(event);
|
||||
}
|
||||
if(props.qfw){
|
||||
var formatMoney=function(s){
|
||||
var formatMoney=function(s: string){
|
||||
var noNegative = true;
|
||||
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
|
||||
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
|
||||
if(parseFloat(s) < 0){
|
||||
s = Math.abs(s).toFixed(2) + "";
|
||||
noNegative = false;
|
||||
@@ -137,8 +137,8 @@ const onBlur = (event: Event) => {
|
||||
try{
|
||||
let reg = /\d{1,3}(?=(\d{3})+$)/g;
|
||||
// new String(props.modelValue).replace(reg, '$&,');
|
||||
console.log("添加,", formatMoney(props.modelValue))
|
||||
currentValue.value = formatMoney(props.modelValue);
|
||||
console.log("添加,", formatMoney(props.modelValue.toString()))
|
||||
currentValue.value = formatMoney(props.modelValue.toString());
|
||||
}catch{
|
||||
currentValue.value = "输入错误"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user