提交 2c3d726b 编写于 作者: S serge-rider

#1716 Number format fix. Minimum fraction digits number depends on column settings.

上级 9b47720a
......@@ -33,6 +33,8 @@ import java.util.Map;
public class NumberDataFormatter implements DBDDataFormatter {
public static final int MAX_DEFAULT_FRACTIONS_DIGITS = 4;
private DecimalFormat numberFormat;
private StringBuffer buffer;
private FieldPosition position;
......@@ -71,7 +73,9 @@ public class NumberDataFormatter implements DBDDataFormatter {
}
if (type != null) {
if (type.getScale() != null && type.getScale() > 0) {
numberFormat.setMinimumFractionDigits(type.getScale());
int fractionDigits = type.getScale();
if (fractionDigits > MAX_DEFAULT_FRACTIONS_DIGITS) fractionDigits = MAX_DEFAULT_FRACTIONS_DIGITS;
numberFormat.setMinimumFractionDigits(fractionDigits);
}
}
buffer = new StringBuffer();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册