// function keepTwoXiaoshu(num) {
// str = num+''
// if(!(str.includes('.'))) {
// val = str+'.00'
// }else {
// len = str.split('.')[1].length
// while(len<2) {
// str+='0'
// len+=1
// }
// if(len>2) {
// alert('金额请保持两位小数')
// return ''
// }
// val = str
// }
// }
let C1_APPLY_SUM = 11
let C1_LAST_YEARS_INCOME = 22.2
let C1_FIXED_ASSETS = 111.111
let money_arr = [C1_APPLY_SUM,C1_LAST_YEARS_INCOME,C1_FIXED_ASSETS]
function keepTwo(money_arr) {
for(let i = 0 ;i<=money_arr.length; i++ ) {
let str = money_arr[i] + ''
if(!str.includes('.')) {
str = str += '.00'
}else {
let len = str.split('.')[1].length
while(len<2) {
str+='0'
len+=1
}
if(len>2) {
alert('金额请保持两位小数')
}
}
}
}
keepTwo(money_arr)
console.log(money_arr)
console