revert fraction format change

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899870 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-04-14 21:46:13 +00:00
parent 31cce15e22
commit 3ed39620f6
1 changed files with 2 additions and 8 deletions

View File

@ -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")