mirror of https://github.com/apache/poi.git
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:
parent
da5d7d44d5
commit
7aab19c3b5
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue