Here you can find the source of convertToFen(BigDecimal num1)
public static Long convertToFen(BigDecimal num1)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static final int STANDARD_ROUND_HALF = BigDecimal.ROUND_HALF_UP; public static final int STANDARD_SCALE = 2; /**//from w w w . ja va2 s . co m * 0 **/ public static final BigDecimal ZERO = new BigDecimal("0"); /** * 100 **/ public static final BigDecimal HUNDRED = new BigDecimal("100"); public static Long convertToFen(BigDecimal num1) { if (null == num1) { return ZERO.longValue(); } BigDecimal temp = multiply(num1, HUNDRED); return temp.longValue(); } public static BigDecimal multiply(BigDecimal num1, BigDecimal num2) { if (null == num1 || null == num2) { return ZERO; } BigDecimal temp = num1.multiply(num2); return temp.setScale(STANDARD_SCALE, STANDARD_ROUND_HALF); } }