Computer Science Canada

HOw to round decimal points.

Author:  DaveAngus [ 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

Author:  Tony [ 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

Author:  DaveAngus [ Tue Apr 01, 2008 10:03 am ]
Post subject:  RE:HOw to round decimal points.

Thanks a lot Tony for the help!

Author:  Doug101 [ 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)

Author:  DaveAngus [ 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

Author:  Doug101 [ Wed Apr 02, 2008 10:42 am ]
Post subject:  Re: HOw to round decimal points.

sry i didnt read his.

Author:  DaveAngus [ Wed Apr 02, 2008 10:43 am ]
Post subject:  RE:HOw to round decimal points.

read all posts before you reply

Author:  Doug101 [ Wed Apr 02, 2008 10:44 am ]
Post subject:  Re: HOw to round decimal points.

sry i didnt really feal like reading them .

Author:  DaveAngus [ Wed Apr 02, 2008 10:46 am ]
Post subject:  RE:HOw to round decimal points.

then dont post

Author:  Tony [ 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.


: