fork(1) download
  1. import java.text.DecimalFormat;
  2.  
  3. class PercentFormat
  4. {
  5. public static void main (String[] args) throws java.lang.Exception
  6. {
  7. double x = 0.15625;
  8. String s = new DecimalFormat("0.0%").format(x);
  9. System.out.println(s);
  10. }
  11. }
Success #stdin #stdout 0.14s 321024KB
stdin
Standard input is empty
stdout
15.62%