What's the suffix after '%' I should use in order to format a Long or a Double type variables?
var LONG : Long = 9L;
println("The value of LONG is %?".format(LONG));
var DOUBLE : Double = 9.9;
println("The value of DOUBLE is %?".format(DOUBLE));
Many thanks.
Here is how you can format in
println
statement we can use String.format() method to format, as shown belowresults you :-
The value of LONG is 9
The value of DOUBLE is 9.90
For more options on formatting flags refer to http://web.cerritos.edu/jwilson/SitePages/java_language_resources/Java_printf_method_quick_reference.pdf