数据处理的自定义函数,供大家分享CªYþlS;bbs.3c3t.comøB"è¹Î P\
Public Function RoundCint(shuzhi, amanalong)CªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
'当小数部分恰好为 0.5 时,Cint 和 CLng 函数会将它转换为最接近的偶数值。例如,0.5 转换为 0、1.5 转换为 2。CintCªYþlS;bbs.3c3t.comøB"è¹Î P\
'和 CLng 函数不同于 Fix 和 Int 函数,Fix 和 Int 函数会将小数部分截断而不是四舍五入。CªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
Dim amanglong As LongCªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
Dim weishu As DoubleCªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
weishu = amanalongCªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
baoliuweishu = shuzhi * (10 ^ weishu)CªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
RoundCint = CInt(baoliuweishu) / 10 ^ weishuCªYþlS;bbs.3c3t.comøB"è¹Î P\
CªYþlS;bbs.3c3t.comøB"è¹Î P\
End FunctionCªYþlS;bbs.3c3t.comøB"è¹Î P\