Problem with System.out.printf command in Java May 9, 2023 by Tarik %d represents an integer; you want to use %f for a double. See the formatting string syntax in the Javadoc