[gnumeric] Make the par argument to ACCRINT optional. [#323545]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Make the par argument to ACCRINT optional. [#323545]
- Date: Wed, 5 May 2010 06:09:10 +0000 (UTC)
commit fdfc595b72dd03bdbbf46575d7654b7d8e0f324d
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Wed May 5 00:08:22 2010 -0600
Make the par argument to ACCRINT optional. [#323545]
2010-05-05 Andreas J. Guelzow <aguelzow pyrshep ca>
* functions.c (gnumeric_accrint): make @{par} optional
(help_accrint): update
(financial_functions): update
NEWS | 1 +
plugins/fn-financial/ChangeLog | 6 ++++++
plugins/fn-financial/functions.c | 8 ++++++--
3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 366c15f..e83543c 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ Andreas:
* Fix Data->Filter->ShowAll for Advanced Filter. [#611079]
* Remove undesired interaction between Advanced Filters and
Autofilters.
+ * Make the par argument to ACCRINT optional. [#323545]
Jean:
* Implement graph only sheets. [#158170]
diff --git a/plugins/fn-financial/ChangeLog b/plugins/fn-financial/ChangeLog
index 7dbfe94..1e628a4 100644
--- a/plugins/fn-financial/ChangeLog
+++ b/plugins/fn-financial/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-05 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * functions.c (gnumeric_accrint): make @{par} optional
+ (help_accrint): update
+ (financial_functions): update
+
2010-04-16 Morten Welinder <terra gnome org>
* Release 1.10.2
diff --git a/plugins/fn-financial/functions.c b/plugins/fn-financial/functions.c
index 279ec28..fe6eaef 100644
--- a/plugins/fn-financial/functions.c
+++ b/plugins/fn-financial/functions.c
@@ -368,6 +368,7 @@ static GnmFuncHelp const help_accrint[] = {
{ GNM_FUNC_HELP_ARG, F_("frequency:number of interest payments per year")},
{ GNM_FUNC_HELP_ARG, F_("basis:calendar basis")},
{ GNM_FUNC_HELP_DESCRIPTION, F_("ACCRINT calculates the accrued interest for a security that pays periodic interest.") },
+ { GNM_FUNC_HELP_NOTE, F_("@{par} defaults to $1000.") },
FREQ_HELP,
GNM_DATE_BASIS_HELP
{ GNM_FUNC_HELP_SEEALSO, "ACCRINTM"},
@@ -388,8 +389,11 @@ gnumeric_accrint (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
!datetime_value_to_g (&settlement, argv[2], date_conv))
return value_new_error_VALUE (ei->pos);
+ if (argv[5] == NULL)
+ return value_new_error_NUM (ei->pos);
+
rate = value_get_as_float (argv[3]);
- par = value_get_as_float (argv[4]);
+ par = argv[4] ? value_get_as_float (argv[4]) : 1000;
freq = value_get_freq (argv[5]);
basis = value_get_basis (argv[6], GO_BASIS_MSRB_30_360);
@@ -3276,7 +3280,7 @@ gnumeric_vdb (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
/***************************************************************************/
GnmFuncDescriptor const financial_functions[] = {
- { "accrint", "ffffff|f",
+ { "accrint", "ffff|fff",
help_accrint, gnumeric_accrint, NULL, NULL, NULL, NULL,
GNM_FUNC_SIMPLE + GNM_FUNC_AUTO_MONETARY,
GNM_FUNC_IMPL_STATUS_COMPLETE, GNM_FUNC_TEST_STATUS_BASIC },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]