|
-
Aug 23rd, 2011, 08:55 PM
#2
Re: Round to the nearest 50th
First up, never use variable names like that. Always use descriptive names unless the meaning is so obvious that a simple name will suffice. Xx and Xxx are definitely not obvious. If you need to use names like 'tempX' and 'finalX' or something like that then do so.
As for the question, you can easily round a value to any number of decimal places, so you should scale (multiply or divide) your value first, then round to the appropriate number of decimal places, then scale back again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|