Java BigDecimal Format formatPercent(BigDecimal percent)

Here you can find the source of formatPercent(BigDecimal percent)

Description

format Percent

License

Open Source License

Declaration

public static String formatPercent(BigDecimal percent) 

Method Source Code


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

import java.math.BigDecimal;

import java.text.DecimalFormat;
import java.text.NumberFormat;

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

    public static String formatPercent(BigDecimal percent) {
        return df.format(Double.parseDouble(percent.toString())) + " %";
    }//from  ww  w.j ava 2 s  . c  o  m
}

Related

  1. formatNumberCroreFormat(final BigDecimal num)
  2. formatNumberDouble(Double amount, int scale)
  3. formatNumberStr(String numberStr, Integer scale)
  4. formatNumer(BigDecimal value, int decimalPlaces, Locale locale, boolean roundCommercial)
  5. formatoDecimal(String tipo, BigDecimal valor)
  6. formatPercentage(BigDecimal percentage)
  7. formatPercentDecimalDouble(Object input)
  8. formatQuantity(BigDecimal quantity)
  9. formatQuantity(BigDecimal quantity)