: :
This message was edited by kainsworth at 2004-9-18 1:16:49
: : : I need to know if it's possible to round off a numerical value that's a decimal to a specified number of decimals, ie. tenths, hundredths, thousandths and so-on? Can anyone help?
: : :
: :
: :
: :
: : It certainly is

You can use the built-in Round function.
: :
: : Dim d As Double = 34.7764645454
: : Label1.Text = Math.Round(d, 3)
: :
: : The first argument is the number you want to truncate, the second one is the level of precision - in the above example it will truncate to three decimal places)
: :
: : Hope this helps
: :
: : Ged
: :
: :
: :
: :
: Oh it most certainly did, I just got done putting it in, I know it was probably a simple thing, I'm just a beginner, I come from a world of 20+ years of programming in COBOL RPG and Fortran plus various 4GL languages, so I kind of new there had to be a way to do it, just not sure how, unfortunately the book we have doesn't even MENTION Math.Round... anyway, thanks very much for your help

:
Pleased that it did

The "problem" - if problem it is - with .Net is that there are just so many classes, functions, methods, etc built into it that it's just impossible to cram them all into a single book. Still it's nice to be spoilt for choice!
The nearest to achieving this that I know of is Francesco Balena with his 1600(!) page book "Programming Visual Basic.Net", MS Press. But even he has had to leave a lot of detail out, so you get an idea of just how much stuff there is tucked away inside that Framework.