某出納單位要求公勞保如有補助,原本為四捨五入計算,要改成無條件進位
原程式為
round()為四捨五入計算
if mislow="1" and msecur1>0 then //公保費
msecur1=round(msecur1*0.75,0) //本人輕殘
end if
if mismid="1" and msecur1>0 then
msecur1=round(msecur1*0.5,0) //本人中殘
end if
if mishigh="1" and msecur1>0 then
msecur1=0 //本人重殘
end if
改成
if mislow="1" and msecur1>0 then //公保費
msecur1=ceiling(msecur1*0.75,0) //本人輕殘
end if
if mismid="1" and msecur1>0 then
msecur1=ceiling(msecur1*0.5,0) //本人中殘
end if
if mishigh="1" and msecur1>0 then
msecur1=0 //本人重殘
end if
但部分單位並未提及,所以需跟客戶確認