Skip to content
Snippets Groups Projects
Unverified Commit 965469d5 authored by Noah Moss's avatar Noah Moss Committed by GitHub
Browse files

fix xlsx exports for data with big integer values (#18323)

parent 23913949
Branches
Tags
No related merge requests found
......@@ -292,7 +292,7 @@
"Returns whether a number should be formatted as an integer after being rounded to 2 decimal places."
[value]
(let [rounded (.setScale (bigdec value) 2 java.math.RoundingMode/HALF_UP)]
(== (int rounded) rounded)))
(== (bigint rounded) rounded)))
(defmulti ^:private set-cell!
"Sets a cell to the provided value, with an approrpiate style if necessary.
......
......@@ -256,10 +256,10 @@
(deftest export-format-test
(testing "Different format strings are used for ints and numbers that round to ints (with 2 decimal places)"
(is (= [["#,##0"] ["#,##0.##"] ["#,##0"] ["#,##0.##"]]
(is (= [["#,##0"] ["#,##0.##"] ["#,##0"] ["#,##0.##"] ["#,##0"] ["#,##0.##"]]
(rest (xlsx-export [{:id 0, :name "Col", :semantic_type :type/Cost}]
{}
[[1] [1.23] [1.004] [1.005]]
[[1] [1.23] [1.004] [1.005] [10000000000] [10000000000.123]]
parse-format-strings)))))
(testing "Misc format strings are included correctly in exports"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment