Skip to content

Commit

Permalink
Update PdfExporter.java
Browse files Browse the repository at this point in the history
[KNOWAGE-8728] export pdf with large numbers is not working
  • Loading branch information
dedalus95 committed Dec 23, 2024
1 parent 1a51e76 commit 5b79fb3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.awt.Color;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
Expand Down Expand Up @@ -216,6 +217,7 @@ private void addDataToTable(BaseTable table, JSONObject settings, JSONArray colu
if (value != null) {
String valueStr = value.toString();
if (type.equalsIgnoreCase("float") && columnStyles[c] != null && columnStyles[c].has("precision")) {
valueStr = new BigDecimal((double) value).toPlainString();
int precision = columnStyles[c].optInt("precision");
int pos = valueStr.indexOf(".");
// offset = 0 se devo tagliare fuori anche la virgola ( in caso precision fosse 0 )
Expand Down

0 comments on commit 5b79fb3

Please sign in to comment.