GenericRecordJsonWriter fix output of floats and doubles

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1870565 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2019-11-29 00:29:05 +00:00
parent da5d7d44d5
commit 7aab19c3b5
1 changed files with 9 additions and 0 deletions

View File

@ -258,6 +258,15 @@ public class GenericRecordJsonWriter implements Closeable {
protected boolean printNumber(String name, Object o) {
Number n = (Number)o;
printName(name);
if (o instanceof Float) {
fw.print(n.floatValue());
return true;
} else if (o instanceof Double) {
fw.print(n.doubleValue());
return true;
}
fw.print(n.longValue());
final int size;