Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
In VB6.0,

Round(1.35,1) gives 1.4

but i need 1.3

Thanks in advance....
Posted

1 solution

You could use Fix for the purpose, e.g.
VB
Dim a as Double
Dim b as Double
a = 1.35
b = Fix(a * 10)/10
 
Share this answer
 
Comments
ThangamSundar 22-Jan-14 4:09am    
its working....
but a=1.2 means its gives 1.1...
but need 1.2
CPallini 22-Jan-14 4:28am    
This is due to intrinsic inaccuracy of internal representation of Double numbers, that is, you write 1.2 in your application but it is actually stored like 1.19999999999...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900