Computer Science Canada

How to round a float or double to 2 decimal places?

Author:  illzidaneyou [ Tue Jan 12, 2010 6:34 pm ]
Post subject:  How to round a float or double to 2 decimal places?

What is the code for rounding a float or double to 2 decimal places?

The only rounding code I know is Math.round() but this only rounds to the nearest 0.5

Please let there be a code!

Any help is appreciated.

Author:  jbking [ Tue Jan 12, 2010 6:55 pm ]
Post subject:  Re: How to round a float or double to 2 decimal places?

Sun's forums has a thread about this already.


: