Skip to content

Commit

Permalink
Fix #336 (#337)
Browse files Browse the repository at this point in the history
Fixed usage of WRITE_BIGDECIMAL_AS_PLAIN when XML pretty printer is
configured.
  • Loading branch information
kevindaub authored and cowtowncoder committed May 23, 2019
1 parent c1787b9 commit bb420a2
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1123,9 +1123,15 @@ public void writeNumber(BigDecimal dec) throws IOException
}
} else {
if (_xmlPrettyPrinter != null) {
_xmlPrettyPrinter.writeLeafElement(_xmlWriter,
_nextName.getNamespaceURI(), _nextName.getLocalPart(),
dec);
if (usePlain) {
_xmlPrettyPrinter.writeLeafElement(_xmlWriter,
_nextName.getNamespaceURI(), _nextName.getLocalPart(),
dec.toPlainString(), false);
} else {
_xmlPrettyPrinter.writeLeafElement(_xmlWriter,
_nextName.getNamespaceURI(), _nextName.getLocalPart(),
dec);
}
} else {
_xmlWriter.writeStartElement(_nextName.getNamespaceURI(), _nextName.getLocalPart());
if (usePlain) {
Expand Down

0 comments on commit bb420a2

Please sign in to comment.