Click to See Complete Forum and Search --> : numbers
PT Exorcist
Nov 22nd, 2002, 09:08 AM
i think this is very easy...isnt there a function that if i have a numbers like 4,3 4,5 4,6 4,9 it will always round it to 4? or 1,5 1,7 1,2 1,1 it will always round to 1?
kovan
Nov 22nd, 2002, 03:07 PM
Math.Round(3.44, 1); //Returns 3.4.
Math.Round(3.45, 1); //Returns 3.4.
Math.Round(3.46, 1); //Returns 3.5.
kovan
Nov 22nd, 2002, 03:09 PM
cast the value to int
it will round it to the lowest Integer number
so if you do
double num = 1.1 //or 1.9
and you do
int newNum = (int)num;
it will make it 1
PT Exorcist
Nov 22nd, 2002, 04:03 PM
ah tks
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.