First, please read our
user name policy. Your name is not a valid user name; please re-register with a first and last name. Thanks.
As for the question - well, to round to 3 digits for example, you could use <code>Math.round(1000 * arg) / 1000.0</code>. However if you print out the result, you may find that the results aren't quite like you want. E.g. you might see an answer like 3.12399999999996 instead of 3.124 - extremely close to what you wnat, but unattractive. Assuming you're really more interested in
displaying numbers with a fixed number of digits (rather than rounding them off in the actual calcualtions), your best bet is to use the
DecimalFormat class - see the tutorial
here.