Java Percentage Format percentFormat(BigDecimal interestRate)

Here you can find the source of percentFormat(BigDecimal interestRate)

Description

percent Format

License

Apache License

Declaration

public static String percentFormat(BigDecimal interestRate) 

Method Source Code


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

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;

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

    public static String percentFormat(BigDecimal interestRate) {
        if (interestRate == null)
            return null;
        return percentFormat.format(interestRate.doubleValue() * 100) + "%";
    }/*from w  w w  . j  ava  2s.c  om*/
}

Related

  1. percentage(float f)
  2. percentageAsString(double input)
  3. percentageFormat(BigDecimal value)
  4. percentDecimalFormat(final double no)
  5. percentFormat()
  6. percentFormat(final BigDecimal bd)
  7. percentFormat(final double value)
  8. percentFormat(float value)
  9. percentFormat(Object object)