From 865913b5c529c2baa2c375a6673434904d572c6e Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 4 Feb 2022 09:49:44 +0000 Subject: [PATCH] add dollarde function git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897752 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/atp/AnalysisToolPak.java | 2 +- .../poi/ss/formula/functions/DollarDe.java | 96 ++++++++++++++++ .../ss/formula/functions/TestDollarDe.java | 107 ++++++++++++++++++ 3 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 poi/src/main/java/org/apache/poi/ss/formula/functions/DollarDe.java create mode 100644 poi/src/test/java/org/apache/poi/ss/formula/functions/TestDollarDe.java diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java index cff8acc520..71071023ab 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/AnalysisToolPak.java @@ -102,7 +102,7 @@ public final class AnalysisToolPak implements UDFFinder { r(m, "DEC2OCT", null); r(m, "DELTA", Delta.instance); r(m, "DISC", null); - r(m, "DOLLARDE", null); + r(m, "DOLLARDE", DollarDe.instance); r(m, "DOLLARFR", null); r(m, "DURATION", null); r(m, "EDATE", EDate.instance); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/DollarDe.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/DollarDe.java new file mode 100644 index 0000000000..f84ec4e5f1 --- /dev/null +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/DollarDe.java @@ -0,0 +1,96 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.ss.formula.functions; + +import org.apache.poi.ss.formula.OperationEvaluationContext; +import org.apache.poi.ss.formula.eval.ErrorEval; +import org.apache.poi.ss.formula.eval.EvaluationException; +import org.apache.poi.ss.formula.eval.NumberEval; +import org.apache.poi.ss.formula.eval.OperandResolver; +import org.apache.poi.ss.formula.eval.ValueEval; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.text.NumberFormat; + +/** + * Implementation for Excel DOLLARDE() function. + *

+ *