From: Jeremias Maerki Date: Wed, 3 Oct 2007 09:58:33 +0000 (+0000) Subject: Bugfix: Make sure floats and doubles are not formatted using exponential format becau... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7392679545d2d15b7ea85b8713259159e547058e;p=xmlgraphics-fop.git Bugfix: Make sure floats and doubles are not formatted using exponential format because PDF doesn't support it. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_PDF_in_PDF@581550 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index c4c8c3a1d..8152fcd83 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -256,7 +256,11 @@ public abstract class PDFObject implements PDFWritable { } else if (obj instanceof PDFWritable) { sb.append(((PDFWritable)obj).toInlinePDFString()); } else if (obj instanceof Number) { - sb.append(obj); + if (obj instanceof Double || obj instanceof Float) { + sb.append(PDFNumber.doubleOut(((Number)obj).doubleValue())); + } else { + sb.append(obj); + } } else if (obj instanceof Boolean) { sb.append(obj); } else {