Kaydet (Commit) f8b9b8ec authored tarafından Johnny_M's avatar Johnny_M Kaydeden (comit) Eike Rathke

Translate German variable names in Calc (financial)

These names of variables correspond to German function names in Calc
and were translated to their English equivalents. For used translations,
see, e.g., https://translations.documentfoundation.org/de/libo54_help/translate/#search=kapz&sfields=target

Change-Id: I5c0e4232b2e7b3039a42aff96a44a8f55c818d2e
Reviewed-on: https://gerrit.libreoffice.org/42993Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarEike Rathke <erack@redhat.com>
üst 17d0dc46
...@@ -1592,29 +1592,29 @@ void ScInterpreter::ScISPMT() ...@@ -1592,29 +1592,29 @@ void ScInterpreter::ScISPMT()
} }
// financial functions // financial functions
double ScInterpreter::ScGetBw(double fInterest, double fZzr, double fRmz, double ScInterpreter::ScGetBw(double fInterest, double fNper, double fPmt,
double fZw, bool bPayInAdvance) double fFv, bool bPayInAdvance)
{ {
double fBw; double fPv;
if (fInterest == 0.0) if (fInterest == 0.0)
fBw = fZw + fRmz * fZzr; fPv = fFv + fPmt * fNper;
else else
{ {
if (bPayInAdvance) if (bPayInAdvance)
fBw = (fZw * pow(1.0 + fInterest, -fZzr)) fPv = (fFv * pow(1.0 + fInterest, -fNper))
+ (fRmz * (1.0 - pow(1.0 + fInterest, -fZzr + 1.0)) / fInterest) + (fPmt * (1.0 - pow(1.0 + fInterest, -fNper + 1.0)) / fInterest)
+ fRmz; + fPmt;
else else
fBw = (fZw * pow(1.0 + fInterest, -fZzr)) fPv = (fFv * pow(1.0 + fInterest, -fNper))
+ (fRmz * (1.0 - pow(1.0 + fInterest, -fZzr)) / fInterest); + (fPmt * (1.0 - pow(1.0 + fInterest, -fNper)) / fInterest);
} }
return -fBw; return -fPv;
} }
void ScInterpreter::ScPV() void ScInterpreter::ScPV()
{ {
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
double nRmz, nZzr, nInterest, nZw = 0; double nPmt, nNper, nInterest, nFv = 0;
bool bPayInAdvance = false; bool bPayInAdvance = false;
sal_uInt8 nParamCount = GetByte(); sal_uInt8 nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 3, 5 ) ) if ( !MustHaveParamCount( nParamCount, 3, 5 ) )
...@@ -1622,11 +1622,11 @@ void ScInterpreter::ScPV() ...@@ -1622,11 +1622,11 @@ void ScInterpreter::ScPV()
if (nParamCount == 5) if (nParamCount == 5)
bPayInAdvance = GetBool(); bPayInAdvance = GetBool();
if (nParamCount >= 4) if (nParamCount >= 4)
nZw = GetDouble(); nFv = GetDouble();
nRmz = GetDouble(); nPmt = GetDouble();
nZzr = GetDouble(); nNper = GetDouble();
nInterest = GetDouble(); nInterest = GetDouble();
PushDouble(ScGetBw(nInterest, nZzr, nRmz, nZw, bPayInAdvance)); PushDouble(ScGetBw(nInterest, nNper, nPmt, nFv, bPayInAdvance));
} }
void ScInterpreter::ScSYD() void ScInterpreter::ScSYD()
...@@ -1634,11 +1634,11 @@ void ScInterpreter::ScSYD() ...@@ -1634,11 +1634,11 @@ void ScInterpreter::ScSYD()
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 4 ) ) if ( MustHaveParamCount( GetByte(), 4 ) )
{ {
double nZr = GetDouble(); double nPer = GetDouble();
double nTimeLength = GetDouble(); double nTimeLength = GetDouble();
double nRest = GetDouble(); double nRest = GetDouble();
double nValue = GetDouble(); double nValue = GetDouble();
double nDia = ((nValue - nRest) * (nTimeLength - nZr + 1.0)) / double nDia = ((nValue - nRest) * (nTimeLength - nPer + 1.0)) /
((nTimeLength * (nTimeLength + 1.0)) / 2.0); ((nTimeLength * (nTimeLength + 1.0)) / 2.0);
PushDouble(nDia); PushDouble(nDia);
} }
...@@ -1920,7 +1920,7 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv, ...@@ -1920,7 +1920,7 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv,
void ScInterpreter::ScPMT() void ScInterpreter::ScPMT()
{ {
double nInterest, nZzr, nBw, nZw = 0; double nInterest, nNper, nPv, nFv = 0;
bool bFlag = false; bool bFlag = false;
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte(); sal_uInt8 nParamCount = GetByte();
...@@ -1929,11 +1929,11 @@ void ScInterpreter::ScPMT() ...@@ -1929,11 +1929,11 @@ void ScInterpreter::ScPMT()
if (nParamCount == 5) if (nParamCount == 5)
bFlag = GetBool(); bFlag = GetBool();
if (nParamCount >= 4) if (nParamCount >= 4)
nZw = GetDouble(); nFv = GetDouble();
nBw = GetDouble(); nPv = GetDouble();
nZzr = GetDouble(); nNper = GetDouble();
nInterest = GetDouble(); nInterest = GetDouble();
PushDouble(ScGetRmz(nInterest, nZzr, nBw, nZw, bFlag)); PushDouble(ScGetRmz(nInterest, nNper, nPv, nFv, bFlag));
} }
void ScInterpreter::ScRRI() void ScInterpreter::ScRRI()
...@@ -1951,26 +1951,26 @@ void ScInterpreter::ScRRI() ...@@ -1951,26 +1951,26 @@ void ScInterpreter::ScRRI()
} }
} }
double ScInterpreter::ScGetZw(double fInterest, double fZzr, double fRmz, double ScInterpreter::ScGetZw(double fInterest, double fNper, double fPmt,
double fBw, bool bFlag) double fPv, bool bFlag)
{ {
double fZw; double fFv;
if (fInterest == 0.0) if (fInterest == 0.0)
fZw = fBw + fRmz * fZzr; fFv = fPv + fPmt * fNper;
else else
{ {
double fTerm = pow(1.0 + fInterest, fZzr); double fTerm = pow(1.0 + fInterest, fNper);
if (bFlag) if (bFlag)
fZw = fBw * fTerm + fRmz*(1.0 + fInterest)*(fTerm - 1.0)/fInterest; fFv = fPv * fTerm + fPmt*(1.0 + fInterest)*(fTerm - 1.0)/fInterest;
else else
fZw = fBw * fTerm + fRmz*(fTerm - 1.0)/fInterest; fFv = fPv * fTerm + fPmt*(fTerm - 1.0)/fInterest;
} }
return -fZw; return -fFv;
} }
void ScInterpreter::ScFV() void ScInterpreter::ScFV()
{ {
double nInterest, nZzr, nRmz, nBw = 0; double nInterest, nNper, nPmt, nPv = 0;
bool bFlag = false; bool bFlag = false;
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte(); sal_uInt8 nParamCount = GetByte();
...@@ -1979,11 +1979,11 @@ void ScInterpreter::ScFV() ...@@ -1979,11 +1979,11 @@ void ScInterpreter::ScFV()
if (nParamCount == 5) if (nParamCount == 5)
bFlag = GetBool(); bFlag = GetBool();
if (nParamCount >= 4) if (nParamCount >= 4)
nBw = GetDouble(); nPv = GetDouble();
nRmz = GetDouble(); nPmt = GetDouble();
nZzr = GetDouble(); nNper = GetDouble();
nInterest = GetDouble(); nInterest = GetDouble();
PushDouble(ScGetZw(nInterest, nZzr, nRmz, nBw, bFlag)); PushDouble(ScGetZw(nInterest, nNper, nPmt, nPv, bFlag));
} }
void ScInterpreter::ScNper() void ScInterpreter::ScNper()
...@@ -2173,32 +2173,32 @@ void ScInterpreter::ScRate() ...@@ -2173,32 +2173,32 @@ void ScInterpreter::ScRate()
PushDouble(fGuess); PushDouble(fGuess);
} }
double ScInterpreter::ScGetCompoundInterest(double fInterest, double fZr, double fZzr, double fBw, double ScInterpreter::ScGetCompoundInterest(double fInterest, double fPer, double fNper, double fPv,
double fZw, bool bPayInAdvance, double& fRmz) double fFv, bool bPayInAdvance, double& fPmt)
{ {
fRmz = ScGetRmz(fInterest, fZzr, fBw, fZw, bPayInAdvance); // for PPMT also if fZr == 1 fPmt = ScGetRmz(fInterest, fNper, fPv, fFv, bPayInAdvance); // for PPMT also if fPer == 1
double fCompoundInterest; double fCompoundInterest;
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
if (fZr == 1.0) if (fPer == 1.0)
{ {
if (bPayInAdvance) if (bPayInAdvance)
fCompoundInterest = 0.0; fCompoundInterest = 0.0;
else else
fCompoundInterest = -fBw; fCompoundInterest = -fPv;
} }
else else
{ {
if (bPayInAdvance) if (bPayInAdvance)
fCompoundInterest = ScGetZw(fInterest, fZr-2.0, fRmz, fBw, true) - fRmz; fCompoundInterest = ScGetZw(fInterest, fPer-2.0, fPmt, fPv, true) - fPmt;
else else
fCompoundInterest = ScGetZw(fInterest, fZr-1.0, fRmz, fBw, false); fCompoundInterest = ScGetZw(fInterest, fPer-1.0, fPmt, fPv, false);
} }
return fCompoundInterest * fInterest; return fCompoundInterest * fInterest;
} }
void ScInterpreter::ScIpmt() void ScInterpreter::ScIpmt()
{ {
double nInterest, nZr, nZzr, nBw, nZw = 0; double nInterest, nPer, nNper, nPv, nFv = 0;
bool bPayInAdvance = false; bool bPayInAdvance = false;
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte(); sal_uInt8 nParamCount = GetByte();
...@@ -2207,23 +2207,23 @@ void ScInterpreter::ScIpmt() ...@@ -2207,23 +2207,23 @@ void ScInterpreter::ScIpmt()
if (nParamCount == 6) if (nParamCount == 6)
bPayInAdvance = GetBool(); bPayInAdvance = GetBool();
if (nParamCount >= 5) if (nParamCount >= 5)
nZw = GetDouble(); nFv = GetDouble();
nBw = GetDouble(); nPv = GetDouble();
nZzr = GetDouble(); nNper = GetDouble();
nZr = GetDouble(); nPer = GetDouble();
nInterest = GetDouble(); nInterest = GetDouble();
if (nZr < 1.0 || nZr > nZzr) if (nPer < 1.0 || nPer > nNper)
PushIllegalArgument(); PushIllegalArgument();
else else
{ {
double nRmz; double nPmt;
PushDouble(ScGetCompoundInterest(nInterest, nZr, nZzr, nBw, nZw, bPayInAdvance, nRmz)); PushDouble(ScGetCompoundInterest(nInterest, nPer, nNper, nPv, nFv, bPayInAdvance, nPmt));
} }
} }
void ScInterpreter::ScPpmt() void ScInterpreter::ScPpmt()
{ {
double nInterest, nZr, nZzr, nBw, nZw = 0; double nInterest, nPer, nNper, nPv, nFv = 0;
bool bPayInAdvance = false; bool bPayInAdvance = false;
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
sal_uInt8 nParamCount = GetByte(); sal_uInt8 nParamCount = GetByte();
...@@ -2232,18 +2232,18 @@ void ScInterpreter::ScPpmt() ...@@ -2232,18 +2232,18 @@ void ScInterpreter::ScPpmt()
if (nParamCount == 6) if (nParamCount == 6)
bPayInAdvance = GetBool(); bPayInAdvance = GetBool();
if (nParamCount >= 5) if (nParamCount >= 5)
nZw = GetDouble(); nFv = GetDouble();
nBw = GetDouble(); nPv = GetDouble();
nZzr = GetDouble(); nNper = GetDouble();
nZr = GetDouble(); nPer = GetDouble();
nInterest = GetDouble(); nInterest = GetDouble();
if (nZr < 1.0 || nZr > nZzr) if (nPer < 1.0 || nPer > nNper)
PushIllegalArgument(); PushIllegalArgument();
else else
{ {
double nRmz; double nPmt;
double nInterestz = ScGetCompoundInterest(nInterest, nZr, nZzr, nBw, nZw, bPayInAdvance, nRmz); double nInterestPer = ScGetCompoundInterest(nInterest, nPer, nNper, nPv, nFv, bPayInAdvance, nPmt);
PushDouble(nRmz - nInterestz); PushDouble(nPmt - nInterestPer);
} }
} }
...@@ -2252,15 +2252,15 @@ void ScInterpreter::ScCumIpmt() ...@@ -2252,15 +2252,15 @@ void ScInterpreter::ScCumIpmt()
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 6 ) ) if ( MustHaveParamCount( GetByte(), 6 ) )
{ {
double fInterest, fZzr, fBw, fStart, fEnd; double fInterest, fNper, fPv, fStart, fEnd;
double fFlag = GetDoubleWithDefault( -1.0 ); double fFlag = GetDoubleWithDefault( -1.0 );
fEnd = ::rtl::math::approxFloor(GetDouble()); fEnd = ::rtl::math::approxFloor(GetDouble());
fStart = ::rtl::math::approxFloor(GetDouble()); fStart = ::rtl::math::approxFloor(GetDouble());
fBw = GetDouble(); fPv = GetDouble();
fZzr = GetDouble(); fNper = GetDouble();
fInterest = GetDouble(); fInterest = GetDouble();
if (fStart < 1.0 || fEnd < fStart || fInterest <= 0.0 || if (fStart < 1.0 || fEnd < fStart || fInterest <= 0.0 ||
fEnd > fZzr || fZzr <= 0.0 || fBw <= 0.0 || fEnd > fNper || fNper <= 0.0 || fPv <= 0.0 ||
( fFlag != 0.0 && fFlag != 1.0 )) ( fFlag != 0.0 && fFlag != 1.0 ))
PushIllegalArgument(); PushIllegalArgument();
else else
...@@ -2268,20 +2268,20 @@ void ScInterpreter::ScCumIpmt() ...@@ -2268,20 +2268,20 @@ void ScInterpreter::ScCumIpmt()
bool bPayInAdvance = ( bool ) fFlag; bool bPayInAdvance = ( bool ) fFlag;
sal_uLong nStart = (sal_uLong) fStart; sal_uLong nStart = (sal_uLong) fStart;
sal_uLong nEnd = (sal_uLong) fEnd ; sal_uLong nEnd = (sal_uLong) fEnd ;
double fRmz = ScGetRmz(fInterest, fZzr, fBw, 0.0, bPayInAdvance); double fPmt = ScGetRmz(fInterest, fNper, fPv, 0.0, bPayInAdvance);
double fCompoundInterest = 0.0; double fCompoundInterest = 0.0;
if (nStart == 1) if (nStart == 1)
{ {
if (!bPayInAdvance) if (!bPayInAdvance)
fCompoundInterest = -fBw; fCompoundInterest = -fPv;
nStart++; nStart++;
} }
for (sal_uLong i = nStart; i <= nEnd; i++) for (sal_uLong i = nStart; i <= nEnd; i++)
{ {
if (bPayInAdvance) if (bPayInAdvance)
fCompoundInterest += ScGetZw(fInterest, (double)(i-2), fRmz, fBw, true) - fRmz; fCompoundInterest += ScGetZw(fInterest, (double)(i-2), fPmt, fPv, true) - fPmt;
else else
fCompoundInterest += ScGetZw(fInterest, (double)(i-1), fRmz, fBw, false); fCompoundInterest += ScGetZw(fInterest, (double)(i-1), fPmt, fPv, false);
} }
fCompoundInterest *= fInterest; fCompoundInterest *= fInterest;
PushDouble(fCompoundInterest); PushDouble(fCompoundInterest);
...@@ -2294,40 +2294,40 @@ void ScInterpreter::ScCumPrinc() ...@@ -2294,40 +2294,40 @@ void ScInterpreter::ScCumPrinc()
nFuncFmtType = css::util::NumberFormat::CURRENCY; nFuncFmtType = css::util::NumberFormat::CURRENCY;
if ( MustHaveParamCount( GetByte(), 6 ) ) if ( MustHaveParamCount( GetByte(), 6 ) )
{ {
double fInterest, fZzr, fBw, fStart, fEnd; double fInterest, fNper, fPv, fStart, fEnd;
double fFlag = GetDoubleWithDefault( -1.0 ); double fFlag = GetDoubleWithDefault( -1.0 );
fEnd = ::rtl::math::approxFloor(GetDouble()); fEnd = ::rtl::math::approxFloor(GetDouble());
fStart = ::rtl::math::approxFloor(GetDouble()); fStart = ::rtl::math::approxFloor(GetDouble());
fBw = GetDouble(); fPv = GetDouble();
fZzr = GetDouble(); fNper = GetDouble();
fInterest = GetDouble(); fInterest = GetDouble();
if (fStart < 1.0 || fEnd < fStart || fInterest <= 0.0 || if (fStart < 1.0 || fEnd < fStart || fInterest <= 0.0 ||
fEnd > fZzr || fZzr <= 0.0 || fBw <= 0.0 || fEnd > fNper || fNper <= 0.0 || fPv <= 0.0 ||
( fFlag != 0.0 && fFlag != 1.0 )) ( fFlag != 0.0 && fFlag != 1.0 ))
PushIllegalArgument(); PushIllegalArgument();
else else
{ {
bool bPayInAdvance = ( bool ) fFlag; bool bPayInAdvance = ( bool ) fFlag;
double fRmz = ScGetRmz(fInterest, fZzr, fBw, 0.0, bPayInAdvance); double fPmt = ScGetRmz(fInterest, fNper, fPv, 0.0, bPayInAdvance);
double fKapZ = 0.0; double fPpmt = 0.0;
sal_uLong nStart = (sal_uLong) fStart; sal_uLong nStart = (sal_uLong) fStart;
sal_uLong nEnd = (sal_uLong) fEnd; sal_uLong nEnd = (sal_uLong) fEnd;
if (nStart == 1) if (nStart == 1)
{ {
if (bPayInAdvance) if (bPayInAdvance)
fKapZ = fRmz; fPpmt = fPmt;
else else
fKapZ = fRmz + fBw * fInterest; fPpmt = fPmt + fPv * fInterest;
nStart++; nStart++;
} }
for (sal_uLong i = nStart; i <= nEnd; i++) for (sal_uLong i = nStart; i <= nEnd; i++)
{ {
if (bPayInAdvance) if (bPayInAdvance)
fKapZ += fRmz - (ScGetZw(fInterest, (double)(i-2), fRmz, fBw, true) - fRmz) * fInterest; fPpmt += fPmt - (ScGetZw(fInterest, (double)(i-2), fPmt, fPv, true) - fPmt) * fInterest;
else else
fKapZ += fRmz - ScGetZw(fInterest, (double)(i-1), fRmz, fBw, false) * fInterest; fPpmt += fPmt - ScGetZw(fInterest, (double)(i-1), fPmt, fPv, false) * fInterest;
} }
PushDouble(fKapZ); PushDouble(fPpmt);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment