I have a variable of double type and the value in it is something like 34.323423423123456 I'd like to format it using String.format method (or whatever works) to have only 2 decimal places (e.g. 34.32), but to also round it properly, e.g. 2.229934345 will be 2.23.
I am new to Java and none the C# tricks worked. Thanks