Here you can find the source of transferDonateAmount2Point(BigDecimal donateAmount)
public static int transferDonateAmount2Point(BigDecimal donateAmount)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { private static final int TEN_YUAN = 10; public static int transferDonateAmount2Point(BigDecimal donateAmount) { if (donateAmount == null) { return 0; }// w ww . ja v a 2 s.c om Double temp = donateAmount.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); return temp.intValue() / TEN_YUAN; } }