[gnumeric] Fix description of MDURATION. [#678520]



commit ed728ef33875f268c4be04e648190e418d9496c2
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date:   Thu Jun 21 01:05:34 2012 -0600

    Fix description of MDURATION. [#678520]
    
    2012-06-21  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* functions.c (help_duration): clarify and add examples
    	(help_mduration): correct description and add examples
    	(help_g_duration): add example

 NEWS                             |    1 +
 plugins/fn-financial/ChangeLog   |    6 ++++++
 plugins/fn-financial/functions.c |   19 ++++++++++++-------
 3 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/NEWS b/NEWS
index 373a48b..6a3d4c7 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,7 @@ Andreas:
 	* Fix cell-clearing/autofilter interaction. [#674814]
 	* Fix autofilter handling of column deletion undo. [#625702]
 	* Fix top-10 and custom autofilter dialogs. [#678258][#678259]
+	* Fix description of MDURATION. [#678520]
 
 Jean:
 	* Fix graph series headers when a multiple selection is used. [#675913]
diff --git a/plugins/fn-financial/ChangeLog b/plugins/fn-financial/ChangeLog
index 0c4674b..d971948 100644
--- a/plugins/fn-financial/ChangeLog
+++ b/plugins/fn-financial/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-21  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* functions.c (help_duration): clarify and add examples
+	(help_mduration): correct description and add examples
+	(help_g_duration): add example
+
 2012-04-21  Morten Welinder <terra gnome org>
 
 	* Release 1.11.3
diff --git a/plugins/fn-financial/functions.c b/plugins/fn-financial/functions.c
index ec72889..fcd1bd5 100644
--- a/plugins/fn-financial/functions.c
+++ b/plugins/fn-financial/functions.c
@@ -1886,17 +1886,19 @@ gnumeric_nper (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_duration[] = {
-        { GNM_FUNC_HELP_NAME, F_("DURATION:the duration of a security")},
+        { GNM_FUNC_HELP_NAME, F_("DURATION:the (Macaulay) duration of a security")},
         { GNM_FUNC_HELP_ARG, F_("settlement:settlement date")},
         { GNM_FUNC_HELP_ARG, F_("maturity:maturity date")},
         { GNM_FUNC_HELP_ARG, F_("coupon:annual coupon rate")},
         { GNM_FUNC_HELP_ARG, F_("yield:annual yield of security")},
         { 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_("DURATION calculates the duration of a security.") },
+	{ GNM_FUNC_HELP_DESCRIPTION, F_("DURATION calculates the (Macaulay) duration of a security.") },
 	FREQ_HELP,
 	GNM_DATE_BASIS_HELP
-        { GNM_FUNC_HELP_SEEALSO, "MDURATION"},
+	{ GNM_FUNC_HELP_EXAMPLES, "=DURATION(TODAY(),TODAY()+365,0.05,0.08,4)"},
+	{ GNM_FUNC_HELP_EXAMPLES, "=DURATION(TODAY(),TODAY()+366,0.05,0.08,4)"},
+        { GNM_FUNC_HELP_SEEALSO, "MDURATION, G_DURATION"},
 	{ GNM_FUNC_HELP_END }
 };
 
@@ -1936,7 +1938,8 @@ static GnmFuncHelp const help_g_duration[] = {
         { GNM_FUNC_HELP_ARG, F_("fv:future value")},
 	{ GNM_FUNC_HELP_DESCRIPTION, F_("G_DURATION calculates the number of periods needed for an investment to attain a desired value.") },
 	{ GNM_FUNC_HELP_ODF, F_("G_DURATION is the OpenFormula function PDURATION.") },
-        { GNM_FUNC_HELP_SEEALSO, "FV,PV"},
+	{ GNM_FUNC_HELP_EXAMPLES, "=G_DURATION(0.08,1000,2000)"},
+        { GNM_FUNC_HELP_SEEALSO, "FV,PV,DURATION,MDURATION"},
 	{ GNM_FUNC_HELP_END }
 };
 
@@ -3231,17 +3234,19 @@ gnumeric_cumprinc (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_mduration[] = {
-        { GNM_FUNC_HELP_NAME, F_("MDURATION:the Macaulay duration of a security")},
+        { GNM_FUNC_HELP_NAME, F_("MDURATION:the modified (Macaulay) duration of a security")},
         { GNM_FUNC_HELP_ARG, F_("settlement:settlement date")},
         { GNM_FUNC_HELP_ARG, F_("maturity:maturity date")},
         { GNM_FUNC_HELP_ARG, F_("coupon:annual coupon rate")},
         { GNM_FUNC_HELP_ARG, F_("yield:annual yield of security")},
         { 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_("MDURATION calculates the Macaulay duration of a security.") },
+	{ GNM_FUNC_HELP_DESCRIPTION, F_("MDURATION calculates the modified (Macaulay) duration of a security.") },
 	FREQ_HELP,
 	GNM_DATE_BASIS_HELP
-        { GNM_FUNC_HELP_SEEALSO, "DURATION"},
+	{ GNM_FUNC_HELP_EXAMPLES, "=MDURATION(TODAY(),TODAY()+365,0.05,0.08,4)"},
+	{ GNM_FUNC_HELP_EXAMPLES, "=MDURATION(TODAY(),TODAY()+366,0.05,0.08,4)"},
+        { GNM_FUNC_HELP_SEEALSO, "DURATION,G_DURATION"},
 	{ GNM_FUNC_HELP_END }
 };
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]