package com.face.util;

import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.text.DecimalFormat;

public class NumberUtils {
    public static String formatYuanAmt(Integer amountFen) {
        if (amountFen == null) {
            return StringUtils.EMPTY;
        }
        DecimalFormat df = new DecimalFormat("0.00");
        return df.format(BigDecimal.valueOf(amountFen).divide(BigDecimal.valueOf(100)));
    }

    public static String formatYuanAmt(BigDecimal amountYuan) {
        if (amountYuan == null) {
            return StringUtils.EMPTY;
        }
        DecimalFormat df = new DecimalFormat("0.00");
        return df.format(amountYuan);
    }
}
