java convert string to double with 2 decimal places code example Example: 2 decimal places print format JAVA printf(%.2f);