Author |
Message |
DaveAngus
|
Posted: Tue Apr 01, 2008 9:14 am Post subject: HOw to round decimal points. |
|
|
Hey guys.
This is such a noob question but it is one of those things I have never bothered learning because you dont think much about it.
HOw do you round dcecimals?
I have this proceduare that when it calculates the answer it NORMALLY comes out like a HUGE decimal.
If you could let me know how to round it to one decimal point,
that would be great!
Thanks a lot,
-Dave |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue Apr 01, 2008 9:41 am Post subject: RE:HOw to round decimal points. |
|
|
rounding to closest integer is done with round(). To save that one (or any number really) decimal point beyond the integer "cutoff", think powers of 10 |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
DaveAngus
|
Posted: Tue Apr 01, 2008 10:03 am Post subject: RE:HOw to round decimal points. |
|
|
Thanks a lot Tony for the help! |
|
|
|
|
|
Doug101
|
Posted: Tue Apr 01, 2008 10:41 am Post subject: Re: HOw to round decimal points. |
|
|
k all you need to do is use the round comand.
eg.
round(variable) |
|
|
|
|
|
DaveAngus
|
Posted: Wed Apr 02, 2008 10:40 am Post subject: RE:HOw to round decimal points. |
|
|
doug...again, Tony helped me.
Therefor I dont need your help
you just copied what he said.
Again, my threads arent for you to boost your posts |
|
|
|
|
|
Doug101
|
Posted: Wed Apr 02, 2008 10:42 am Post subject: Re: HOw to round decimal points. |
|
|
sry i didnt read his. |
|
|
|
|
|
DaveAngus
|
Posted: Wed Apr 02, 2008 10:43 am Post subject: RE:HOw to round decimal points. |
|
|
read all posts before you reply |
|
|
|
|
|
Doug101
|
Posted: Wed Apr 02, 2008 10:44 am Post subject: Re: HOw to round decimal points. |
|
|
sry i didnt really feal like reading them . |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DaveAngus
|
Posted: Wed Apr 02, 2008 10:46 am Post subject: RE:HOw to round decimal points. |
|
|
then dont post |
|
|
|
|
|
Tony
|
Posted: Wed Apr 02, 2008 10:53 am Post subject: RE:HOw to round decimal points. |
|
|
DaveAngus has an excellent point there. Saying random stuff without reading the thread is a quick way to get banned. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|