Java Number Percentage Format getPercent(double percent)

Here you can find the source of getPercent(double percent)

Description

get Percent

License

Apache License

Declaration

public static String getPercent(double percent) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.DecimalFormat;

public class Main {
    public static String getPercent(double percent) {
        return new DecimalFormat("#.##").format(percent);
    }//from   www.j av a2  s  .co  m

    public static String getPercent(float percent) {
        return new DecimalFormat("#.##").format(percent);
    }
}

Related

  1. getPercent(Double num)
  2. getPercent(Double value)
  3. getPercent(final long downloadCurrent, final long downloadMax)
  4. getPercent(long l1, long l2)
  5. getPercent(long val1, long val2)