Java Percentage Format percentage(Double v, String postfix)

Here you can find the source of percentage(Double v, String postfix)

Description

percentage

License

Apache License

Declaration

public static String percentage(Double v, String postfix) 

Method Source Code


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

import java.text.DecimalFormat;

public class Main {
    public static String percentage(Double v, String postfix) {
        return new DecimalFormat("0.00").format(100. * v) + postfix;
    }// ww w.ja  va 2 s.c  o  m

    public static String percentage(Double v) {
        return percentage(v, "%");
    }
}

Related

  1. getPercentageString(double percent)
  2. getRoundPercent(double f)
  3. numberToPercent2Scale(Double number)
  4. percent(double number)
  5. percent(double p1, double p2)
  6. percentage(float f)
  7. percentageAsString(double input)
  8. percentageFormat(BigDecimal value)
  9. percentDecimalFormat(final double no)