function price (val,types, isNoUnpin, customModel) { let type = types if(!val || isNaN(Number(val))) { if (isNoUnpin) return type ? '0':'0.00' else return type ? '0万元':'0.00元' } else { if (customModel && Number(val) > 9999) type = true let numb = type ? parseFloat((Number(val)/10000).toFixed(2)) : Number(val).toFixed(2) ,str = numb.toString() ,arr = str.split('.') ,num0 = '' ,re = /(?=(?!)(d{3})+$)/g num0 = arr[0] if(num0.length>3){ num0 = num0.replace(re, ',') } let unpin = type ? '万元' : '元' if (isNoUnpin) unpin = '' return num0 + (arr[1] ? '.'+arr[1]: '')+ unpin } } price(100, false, false, true) "100.00元" function price (val,types, isNoUnpin, customModel) { let type = types if(!val || isNaN(Number(val))) { if (isNoUnpin) return type ? '0':'0.00' else return type ? '0万元':'0.00元' } else { if (customModel && Number(val) > 9999) type = true let numb = type ? parseFloat((Number(val)/10000).toFixed(2)) : Number(val).toFixed(2) ,str = numb.toString() ,arr = str.split('.') ,num0 = '' ,re = /(?=(?!)(d{3})+$)/g num0 = arr[0] if(num0.length>3){ num0 = num0.replace(re, ',') } let unpin = type ? '万元' : '元' if (isNoUnpin) unpin = '' return num0 + (arr[1] ? '.'+arr[1]: '')+ unpin } } price(10000, false, false, true) "1万元" function price (val,types, isNoUnpin, customModel) { let type = types if(!val || isNaN(Number(val))) { if (isNoUnpin) return type ? '0':'0.00' else return type ? '0万元':'0.00元' } else { if (customModel && Number(val) > 9999) type = true let numb = type ? parseFloat((Number(val)/10000).toFixed(2)) : Number(val).toFixed(2) ,str = numb.toString() ,arr = str.split('.') ,num0 = '' ,re = /(?=(?!)(d{3})+$)/g num0 = arr[0] if(num0.length>3){ num0 = num0.replace(re, ',') } let unpin = type ? '万元' : '元' if (isNoUnpin) unpin = '' return num0 + (arr[1] ? '.'+arr[1]: '')+ unpin } } price(10000, false, false) "10,000.00元" function price (val,types, isNoUnpin, customModel) { let type = types if(!val || isNaN(Number(val))) { if (isNoUnpin) return type ? '0':'0.00' else return type ? '0万元':'0.00元' } else { if (customModel && Number(val) > 9999) type = true let numb = type ? parseFloat((Number(val)/10000).toFixed(2)) : Number(val).toFixed(2) ,str = numb.toString() ,arr = str.split('.') ,num0 = '' ,re = /(?=(?!)(d{3})+$)/g num0 = arr[0] if(num0.length>3){ num0 = num0.replace(re, ',') } let unpin = type ? '万元' : '元' if (isNoUnpin) unpin = '' return num0 + (arr[1] ? '.'+arr[1]: '')+ unpin } } price(100, false, false) "100.00元"