tballison commented on code in PR #1473:
URL: https://github.com/apache/poi/pull/1473#discussion_r4377095900
##########
poi/src/main/java/org/apache/poi/ss/format/CellNumberFormatter.java:
##########
@@ -680,7 +682,13 @@ private void writeFraction(double value, StringBuffer
result,
} else {
// buildFractionMaxDenominator only gives denominators below the
maximum it is passed, so pass
// 10^digits, as FractionFormat does: e.g. "??/??" shows 0.99 as
98/99, where 99 would give 1/1
- SimpleFraction frac =
SimpleFraction.buildFractionMaxDenominator(fractional, maxDenominator + 1);
+ SimpleFraction frac;
+ try {
+ frac = SimpleFraction.buildFractionMaxDenominator(fractional,
maxDenominator + 1);
+ } catch (RuntimeException e) {
+ LOG.atError().withThrowable(e).log("error while fraction
evaluation");
+ frac = new
SimpleFraction(Math.toIntExact(Math.round(fractional)), 1);
Review Comment:
Yep. Fixed with change for comment 3.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]