Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need to display exact int value


if val=1900

i need to show

--> val=val/1000

val =1 --- required

in vb.net

if val > 0.5 it rounds the result


if val < 0.5
showing correct result

but i val in vb.net showing - '2' making round value

how can i ?

can any one help me
Posted

Instead of using
'/' (Division)

1900/1000 = 1.9

use
'\' (Integer division)

1900\1000 = 1
 
Share this answer
 
 
Share this answer
 

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