diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/FractionFormat.java b/poi/src/main/java/org/apache/poi/ss/usermodel/FractionFormat.java index f5ffd91faf..da1abe6b6e 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/FractionFormat.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/FractionFormat.java @@ -106,14 +106,8 @@ public class FractionFormat extends Format { @SuppressWarnings("squid:S2111") public String format(Number num) { - final double d = num.doubleValue();; - try { - //this is the recommended way (in BigDecimal javadocs to create a decimal from a double) - return format(new BigDecimal(Double.toString(d))); - } catch (NumberFormatException nfe) { - //Double.toString can fail - return format(d); - } + final double d = num.doubleValue(); + return format(new BigDecimal(d)); } @SuppressWarnings("squid:S2111")