net.wicp.tams.common.callback.impl.convertvalue.ConvertValueMoney Maven / Gradle / Ivy
package net.wicp.tams.common.callback.impl.convertvalue;
import java.math.BigDecimal;
import net.wicp.tams.common.apiext.NumberUtil;
import net.wicp.tams.common.callback.IConvertValue;
/***
* 把钱转为字符
* @author zhoujunhui
*
*/
public class ConvertValueMoney implements IConvertValue {
@Override
public String getStr(String keyObj) {
try {
BigDecimal retObj = NumberUtil.handleScale(String.valueOf(keyObj),
2);
return String.valueOf(retObj);
} catch (Exception e) {
return keyObj;
}
}
}