增加Am数量计算函数,修复浮点数界面显示精度问题。

yun-zuoyi
钮海涛 4 years ago
parent 258e51aaf1
commit 7db1f3e3a1

@ -70,6 +70,20 @@ public abstract class BaseAPS extends BaseBean {
return null;
}
public Double getCustomDouble(String code) {
Object value = customFields.get(code);
if (value == null) {
return null;
}
if (value.getClass() == String.class) {
return Double.valueOf((String) value);
} else if(value.getClass() == Double.class) {
return (Double)value;
}
return null;
}
public Boolean getCustomBoolean(String code) {
Object value = customFields.get(code);
if (value == null) {

@ -4,4 +4,15 @@ public class APSDoubleTool {
public static boolean isZero(Double value) {
return (value == null) || (value > -0.0000001 && value < 0.0000001);
}
/**
*
* @param value
* @param pric
* @return
*/
public static double ceilPric(double value, int pric) {
final double digits = Math.pow(10.0, pric);
return Math.ceil(value*digits) / digits;
}
}

Loading…
Cancel
Save