Java BigDecimal transferDonateAmount2Point(BigDecimal donateAmount)

Here you can find the source of transferDonateAmount2Point(BigDecimal donateAmount)

Description

transfer Donate Amount Point

License

Apache License

Declaration

public static int transferDonateAmount2Point(BigDecimal donateAmount) 

Method Source Code


//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;
    }
}

Related

  1. strToBigDecimal(final String arg)
  2. strValueBigDecimal(Number number)
  3. tangent(BigDecimal x)
  4. tanto(BigDecimal r, BigDecimal n)
  5. textToBigDecimal(String amountAsText)
  6. tryParseBigDecimal(Object val, BigDecimal defaultVal)
  7. tryToStoreAsIntegerBigDecimal(Object ob)
  8. tryToStoreAsRealBigDecimal(Object ob)
  9. unformattedFromBigDecimal(BigDecimal n)