package org.arpit.java2blog; public class PrintfformatDouble { public static void main(String[] args) { double d = 2.456534; System.out.printf("Double upto 2 decimal places: %.2f",d); } }