Java Percentage Format percentFormat(Object object)

Here you can find the source of percentFormat(Object object)

Description

percent Format

License

Apache License

Declaration

public static String percentFormat(Object object) 

Method Source Code

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

import java.text.NumberFormat;

public class Main {

    public static String percentFormat(Object object) {
        if (object == null) {
            return "";
        }//w w  w . ja  v a  2  s . com
        NumberFormat percent = NumberFormat.getPercentInstance();
        percent.setMaximumFractionDigits(2);
        return percent.format(object);
    }
}

Related

  1. percentFormat()
  2. percentFormat(BigDecimal interestRate)
  3. percentFormat(final BigDecimal bd)
  4. percentFormat(final double value)
  5. percentFormat(float value)
  6. percentTotal(double value, double total)
  7. roundedPercentageGreaterThan(double left, double right)
  8. toPercent(Double doubleValue)
  9. toPercent(double percent)