Java Number Percentage Format getPercent(Double num)

Here you can find the source of getPercent(Double num)

Description

get Percent

License

Open Source License

Declaration

public static String getPercent(Double num) 

Method Source Code

//package com.java2s;

import java.text.DecimalFormat;

public class Main {

    public static String getPercent(Double num) {
        DecimalFormat df = new DecimalFormat("############0.00");
        String rtNum = df.format(num * 100);

        return rtNum + "%";
    }/*ww w  . j  a  va  2s  .c o  m*/
}

Related

  1. getPercent(double percent)
  2. getPercent(Double value)
  3. getPercent(final long downloadCurrent, final long downloadMax)
  4. getPercent(long l1, long l2)