try to standardise div code

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899681 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-04-09 12:07:31 +00:00
parent a8f1e7acd1
commit ac3a104c82

View File

@ -803,7 +803,7 @@ public class DataFormatter {
if (obj instanceof BigDecimal) {
obj = ((BigDecimal) obj).divide(divider, RoundingMode.HALF_UP);
} else if (obj instanceof Double) {
obj = (Double) obj / divider.doubleValue();
obj = (new BigDecimal(NumberToTextConverter.toText((Double)obj))).divide(divider, RoundingMode.HALF_UP);
} else {
throw new UnsupportedOperationException();
}