+ 3

Java help code

public class Decimal { public static void main(String[] args) { double num = 1.34567; System.out.format("%.4f", num); } }

22nd Dec 2017, 8:22 PM
Robin
Robin - avatar
3 Answers
+ 6
format does exactly what its name implies, it takes num(1.34567) and formats it to 4 decimal places(%.4f) "%f" means floating point, "%d" is integer "%s" is string
22nd Dec 2017, 8:28 PM
David Akhihiero
David Akhihiero - avatar
+ 1
what is this format stands for and inside parancetes also
22nd Dec 2017, 8:23 PM
Robin
Robin - avatar
0
Yerucham can you tell me your fb or instagram or any other contact link.
23rd Dec 2017, 9:10 AM
Robin
Robin - avatar