package cn.quant.andy.text;

import java.math.BigDecimal;
import java.text.ParseException;

/**
 * Created by Administrator on 2021/7/19 0019.
 */
public class BigDecimalFormatter extends StringFormatter {

    public final static String FORMATTER_TYPE = "b";

    Group format(String pattern, String text) throws ParseException {
        String[] split = pattern.split("\\.");
        BigDecimal bigDecimal = new BigDecimal(text);
        bigDecimal = bigDecimal.setScale(Integer.parseInt(split[1]));
        Group group = new Group();
        group.value = bigDecimal;
        return group;
    }
}
