Rounding a decimal

EStallworth

Well-known member
Joined
Aug 14, 2006
Messages
75
Location
Destin, FL
Programming Experience
Beginner
I am having a problem which seems simple, but to a noob like me it is a little bit complicated.

I have an application that I transfered from vs.net(2k3) to vb2k5 and as I understand by all the error messages you cannot use decimal.round on an object. I replaced all of those statements with system.math.round and just realized that it converts to an integer(because I kept gettin whole numbers in my SQL table where there should have been decimal values). So what I did was created variables for each value I need to grab and then used the decimal.round.

ex:
dim somenum as decimal
somenum= CType(txtbox1.text, decimal) or val(txtbox1.text)
somenum= decimal.round(somenum, 2)


My question is: Is there another way to round values of objects without having to declare variables for each instance?¿
 
Now I feel like an idiot! Been too long of a day when I cannot put 1 and 2 together. LOL!

Thanks for the info dude!
 
Back
Top