like:
0.625 Take 1
2.1 Take 3
3.6 Take 4
<%
if fix(a)>a then
b=fix(a)
else
b=fix(a)+1
response.write b
end if
%>
or:
<%
a=0.625
if a<>fix(a) then
a=fix(a)+1
else
a=fix(a)
end if
response.write a
%>
(Note: This test succeeds!)
----------------------
If using:
<%
a=0.625
if a<>cint(a) then
a=cint(a)+1
response.write a
end if
%>
(Note: If a=0.625, the returned one will become 2, instead of 1.)
Articles that may be of interest to you:
JS retains decimal points (rounding, rounding) implementation ideas and examples javascript decimal rounding multiple methods to implement js digital input box (including maximum value minimum value limit and rounding) js rounding problem for special data PHP retains two decimal places and rounding and not rounding method C# rounding rounding and banker rounding implementation code