Round number to fewer decimals

There are severals ways to accomplish this. The example below shows two of them.
The second example is only possible if you run Java version 1.5 or later.

The output of either one of the above rounding methods is:

Search for more Java info on this site here:
Custom Search

Any thoughts or questions?