Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 17890;
- double d = (double)num/100;
- System.out.println(d); *//выводит 178.9, а не 178.90*
- double d=1.23456789;
- System.out.printf("d=%.10fn", d);
- int num = 17890;
- double d = (double)num/100;
- System.out.println(d); //выводит 178.9, а не 178.90
- DecimalFormat format = new DecimalFormat("#.00");
- System.out.println(format.format(d)); // выводит 178.90
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement