Java BigDecimal Format formatYuan2Fen(double fee)

Here you can find the source of formatYuan2Fen(double fee)

Description

format Yuan Fen

License

Apache License

Declaration

public static int formatYuan2Fen(double fee) 

Method Source Code


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

import java.math.BigDecimal;

public class Main {

    public static int formatYuan2Fen(double fee) {
        BigDecimal _fee = new BigDecimal(Double.toString(fee));
        return _fee.multiply(new BigDecimal("100")).setScale(0, BigDecimal.ROUND_HALF_EVEN).intValue();
    }/*  ww  w  . j  a  va 2 s  . c  o  m*/
}

Related

  1. formattedFromBigDecimal(BigDecimal number, int scale, Locale locale)
  2. formattedToBigDecimal(String str, Locale locale)
  3. formatTime(BigDecimal seconds)
  4. formatTwoDecimals(float num)
  5. formatUnwithE(Object arg)
  6. getFormatSizeByKB(long size)
  7. isLess(float formateValue1, float formateValue2)
  8. timeToEMTFormat(long elapsedTimeMillis)
  9. toNormalFenFormat(String fen)