注册 登录
编程论坛 ASP技术论坛

不足0.5按0.5记,不足1按1记

anjincheng 发布于 2008-06-07 10:18, 586 次点击
老师们:
    不足0.5按0.5记,不足1按1记,怎么实现?

如2.35,应记为2.5
  2.56,应记为3.0
1 回复
#2
hmhz2008-06-07 10:28
<%
Price="2.35"
if left(split(Price,".")(1),1)<5 then
Prices=split(Price,".")(0)&".5"
else
Prices=split(Price,".")(0)+1&".0"
end if
%>

<%=Prices%>
1