import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.Scanner; public class DecimalFormatting { public static void main(String[] args) { float my_input; System.out.println("Required packages have been imported"); Scanner my_scanner = new Scanner(System.in); System.out.println("A scanner object has been defined "); System.out.print("Enter the first binary number : "); my_input = my_scanner.nextFloat(); DecimalFormat roundup_decimal = new DecimalFormat("#.#"); roundup_decimal.setRoundingMode(RoundingMode.CEILING); System.out.println("The rounded up value of " +my_input + " is "); System.out.println(roundup_decimal.format(my_input)); } }