Java Percentage Format getPercentageString(double percent)

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

Description

get Percentage String

License

Open Source License

Declaration

public static String getPercentageString(double percent) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.text.DecimalFormat;

public class Main {
    private static DecimalFormat df = new DecimalFormat("##.##");

    public static String getPercentageString(double percent) {
        return df.format(percent * 100f) + "%";
    }/* ww  w . jav  a2 s  .c o  m*/
}

Related

  1. getPercentage(double number)
  2. getPercentage(double number, int fractionDigits)
  3. getPercentage(int numerator, int denominator)
  4. getPercentage(long duration, long lapso)
  5. getPercentage(long numerator, long denominator)
  6. getRoundPercent(double f)
  7. numberToPercent2Scale(Double number)
  8. percent(double number)
  9. percent(double p1, double p2)