Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
GNOME
gnumeric
Commits
36247c4a
Commit
36247c4a
authored
Sep 22, 1998
by
Arturo Espinosa
Browse files
Update the fn-date as well
parent
de44bc98
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
288 additions
and
777 deletions
+288
-777
plugins/fn-date/functions.c
plugins/fn-date/functions.c
+63
-63
plugins/fn-math/functions.c
plugins/fn-math/functions.c
+33
-196
src/fn-date.c
src/fn-date.c
+63
-63
src/fn-math.c
src/fn-math.c
+33
-196
src/functions/fn-date.c
src/functions/fn-date.c
+63
-63
src/functions/fn-math.c
src/functions/fn-math.c
+33
-196
No files found.
plugins/fn-date/functions.c
View file @
36247c4a
...
...
@@ -16,19 +16,19 @@
#define DAY_SECONDS (3600*24)
static
char
*
help_date
=
{
N_
(
"
<function>DATE</function>
"
"
<syntax>
DATE (year,month,day)
</syntax>
n"
N_
(
"
@FUNCTION=DATE
"
"
@SYNTAX=
DATE (year,month,day)n"
"
<description>
"
"
@DESCRIPTION=
"
"Computes the number of days since the 1st of jannuary of 1900"
"(the date serial number) for the given year, month and day.
<p>
"
"(the date serial number) for the given year, month and day.
\n
"
"The day might be negative (to count backwards) and it is relative"
"to the previous month"
"
<p>
"
"
\n
"
"
</description>
"
"
<seealso>
TODAY, NOW
</seealso>
"
)
""
"
@SEEALSO=
TODAY, NOW"
)
};
static
Value
*
...
...
@@ -57,16 +57,16 @@ gnumeric_date (struct FunctionDefinition *fd, Value *argv [], char **error_strin
}
static
char
*
help_today
=
{
N_
(
"
<function>TODAY</function>
"
"
<syntax>TODAY ()</syntax>
n"
N_
(
"
@FUNCTION=TODAY
"
"
@SYNTAX=TODAY ()
n"
"
<description>
"
"
@DESCRIPTION=
"
"Returns the serial number for today (the number of days"
"trasncurred since the 1st of Jannuary of 1990"
"
<p>
"
"
\n
"
"
</description>
"
"
<seealso>
TODAY, NOW
</seealso>
"
)
""
"
@SEEALSO=
TODAY, NOW"
)
};
static
Value
*
...
...
@@ -83,24 +83,24 @@ gnumeric_today (FunctionDefinition *fd, Value *argv [], char **error_string)
}
static
char
*
help_now
=
{
N_
(
"
<function>NOW</function>
"
"
<syntax>NOW ()</syntax>
n"
N_
(
"
@FUNCTION=NOW
"
"
@SYNTAX=NOW ()
n"
"
<description>
"
"
@DESCRIPTION=
"
"Returns the serial number for the date and time at the time"
"it is evaluated.
<p>
"
"it is evaluated.
\n
"
""
"Serial Numbers in Gnumeric are represented as follows:"
"The integral part is the number of days since the 1st of "
"Jannuary of 1900. The decimal part represent the fraction "
"of the day and is mapped into hour, minutes and seconds
<p>
"
"of the day and is mapped into hour, minutes and seconds
\n
"
""
"For example: .0 represents the beginning of the day, and 0.5 "
"represents noon"
"
<p>
"
"
\n
"
"
</description>
"
"
<seealso>
TODAY, NOW
</seealso>
"
)
""
"
@SEEALSO=
TODAY, NOW"
)
};
static
Value
*
...
...
@@ -120,15 +120,15 @@ gnumeric_now (FunctionDefinition *fd, Value *argv [], char **error_string)
}
static
char
*
help_time
=
{
N_
(
"
<function>TIME</function>
"
"
<syntax>
TIME (hours,minutes,seconds)
</syntax>
n"
N_
(
"
@FUNCTION=TIME
"
"
@SYNTAX=
TIME (hours,minutes,seconds)n"
"
<description>
"
"
@DESCRIPTION=
"
"Returns a fraction representing the hour"
"
<p>
"
"
\n
"
"
</description>
"
"
<seealso>HOUR</seealso>
"
)
""
"
@SEEALSO=HOUR
"
)
};
static
Value
*
...
...
@@ -148,48 +148,48 @@ gnumeric_time (FunctionDefinition *fd, Value *argv [], char **error_string)
}
static
char
*
help_hour
=
{
N_
(
"
<function>HOUR</function>
"
"
<syntax>
HOUR (serial_number)
</syntax>
n"
N_
(
"
@FUNCTION=HOUR
"
"
@SYNTAX=
HOUR (serial_number)n"
"
<description>
"
"
@DESCRIPTION=
"
"Converts a serial number to an hour. The hour is returned as "
"an integer in the range 0 (12:00 A.M.) to 23 (11:00 P.M.)"
"
<p>
"
"
\n
"
"Note that Gnumeric will perform regular string to serial "
"number conversion for you, so you can enter a date as a "
"string"
"
</description>
"
"
<seealso>
MINUTE, NOW, TIME, SECOND
</seealso>
"
)
""
"
@SEEALSO=
MINUTE, NOW, TIME, SECOND"
)
};
static
char
*
help_minute
=
{
N_
(
"
<function>MINUTE</function>
"
"
<syntax>
MINUTE (serial_number)
</syntax>
n"
N_
(
"
@FUNCTION=MINUTE
"
"
@SYNTAX=
MINUTE (serial_number)n"
"
<description>
"
"
@DESCRIPTION=
"
"Converts a serial number to a minute. The minute is returned as "
"an integer in the range 0 to 59"
"
<p>
"
"
\n
"
"Note that Gnumeric will perform regular string to serial "
"number conversion for you, so you can enter a date as a "
"string"
"
</description>
"
"
<seealso>
HOUR, NOW, TIME, SECOND
</seealso>
"
)
""
"
@SEEALSO=
HOUR, NOW, TIME, SECOND"
)
};
static
char
*
help_second
=
{
N_
(
"
<function>SECOND</function>
"
"
<syntax>
SECOND (serial_number)
</syntax>
n"
N_
(
"
@FUNCTION=SECOND
"
"
@SYNTAX=
SECOND (serial_number)n"
"
<description>
"
"
@DESCRIPTION=
"
"Converts a serial number to a second. The second is returned as "
"an integer in the range 0 to 59"
"
<p>
"
"
\n
"
"Note that Gnumeric will perform regular string to serial "
"number conversion for you, so you can enter a date as a "
"string"
"
</description>
"
"
<seealso>
HOUR, MINUTE, NOW, TIME
</seealso>
"
)
""
"
@SEEALSO=
HOUR, MINUTE, NOW, TIME"
)
};
/*
...
...
@@ -216,45 +216,45 @@ gnumeric_hour_min_sec (FunctionDefinition *fd, Value *argv [], char **error_stri
}
static
char
*
help_year
=
{
N_
(
"
<function>YEAR</function>
"
"
<syntax>
YEAR (serial_number)
</syntax>
n"
N_
(
"
@FUNCTION=YEAR
"
"
@SYNTAX=
YEAR (serial_number)n"
"
<description>
"
"
@DESCRIPTION=
"
"Converts a serial number to a year."
"
<p>
"
"
\n
"
"Note that Gnumeric will perform regular string to serial "
"number conversion for you, so you can enter a date as a "
"string"
"
</description>
"
"
<seealso>
DAY, MONTH, TIME, NOW
</seealso>
"
)
""
"
@SEEALSO=
DAY, MONTH, TIME, NOW"
)
};
static
char
*
help_month
=
{
N_
(
"
<function>MONTH</function>
"
"
<syntax>
MONTH (serial_number)
</syntax>
n"
N_
(
"
@FUNCTION=MONTH
"
"
@SYNTAX=
MONTH (serial_number)n"
"
<description>
"
"
@DESCRIPTION=
"
"Converts a serial number to a month."
"
<p>
"
"
\n
"
"Note that Gnumeric will perform regular string to serial "
"number conversion for you, so you can enter a date as a "
"string"
"
</description>
"
"
<seealso>
DAY, TIME, NOW, YEAR
</seealso>
"
)
""
"
@SEEALSO=
DAY, TIME, NOW, YEAR"
)
};
static
char
*
help_day
=
{
N_
(
"
<function>DAY</function>
"
"
<syntax>
DARY (serial_number)
</syntax>
n"
N_
(
"
@FUNCTION=DAY
"
"
@SYNTAX=
DARY (serial_number)n"
"
<description>
"
"
@DESCRIPTION=
"
"Converts a serial number to a day."
"
<p>
"
"
\n
"
"Note that Gnumeric will perform regular string to serial "
"number conversion for you, so you can enter a date as a "
"string"
"
</description>
"
"
<seealso>
MONTH, TIME, NOW, YEAR
</seealso>
"
)
""
"
@SEEALSO=
MONTH, TIME, NOW, YEAR"
)
};
static
Value
*
...
...
plugins/fn-math/functions.c
View file @
36247c4a
...
...
@@ -134,11 +134,6 @@ static char *help_atan2 = {
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=ATAN, ATANH, COS, SIN, DEGREES, RADIANS"
)
};
...
...
@@ -157,10 +152,6 @@ static char *help_atanh = {
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=ATAN, TAN, SIN, COS, DEGREES, RADIANS"
)
};
...
...
@@ -178,11 +169,7 @@ static char *help_atan = {
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=TAN, COS, SIN, DEGREES, RADIANS"
)
};
...
...
@@ -198,11 +185,6 @@ static char *help_asinh = {
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=ASIN, SIN, COS, DEGREES, RADIANS"
)
};
...
...
@@ -216,15 +198,9 @@ static char *help_asin = {
"the value whose sine is b1. If b1 falls outside the range "
"-1 to 1, ASIN fails and returns the error 'asin - domain error' "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=SIN, COS, ASINH, DEGREES, RADIANS"
)
};
...
...
@@ -239,15 +215,9 @@ static char *help_acosh = {
"b1. If b1 is less than 1.0, acosh() returns the error "
" 'acosh - domain error'"
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=ACOS, DEGREES, RADIANS "
)
};
...
...
@@ -261,18 +231,23 @@ static char *help_acos = {
" range -1 to 1, ACOS fails and returns the error 'acos - domain error'. "
" The value it returns is in radians. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=COS, SIN, DEGREES, RADIANS"
)
};
static
char
*
help_average
=
{
N_
(
"@FUNCTION=AVERAGE"
"@SYNTAX=AVERAGE(value1, value2,...)"
"@DESCRIPTION="
"Computes the average of all the values and cells referenced in the "
"argument list. This is equivalent to the sum of the arguments divided "
"by the count of the arguments."
""
"@SEEALSO=SUM, COUNT"
)
};
static
char
*
help_tanh
=
{
N_
(
"@FUNCTION=TANH"
...
...
@@ -282,15 +257,9 @@ static char *help_tanh = {
" The TANH function returns the hyperbolic tangent of b1, "
" which is defined mathematically as sinh(b1) / cosh(b1). "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=TAN, SIN, SINH, COS, COSH, DEGREES, RADIANS"
)
};
...
...
@@ -302,15 +271,9 @@ static char *help_tan = {
"The TAN function returns the tangent of b1, where b1 is "
"given in radians. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=TANH, COS, COSH, SIN, SINH, DEGREES, RADIANS"
)
};
...
...
@@ -324,15 +287,9 @@ static char *help_sinh = {
"which is defined mathematically as (exp(b1) - exp(-b1)) / 2. "
" b1 is in radians. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=SIN, COS, COSH, TAN, TANH, DEGREES, RADIANS, EXP"
)
};
...
...
@@ -345,16 +302,9 @@ static char *help_cosh = {
" which is defined mathematically as (exp(b1) + exp(-b1)) / 2. "
" b1 is in radians. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=COS, SIN, SINH, TAN, TANH, RADIANS, DEGREES, EXP"
)
};
...
...
@@ -367,15 +317,9 @@ static char *help_sin = {
"The SIN function returns the sine of b1, where b1 is given "
" in radians. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=COS, COSH, SINH, TAN, TANH, RADIANS, DEGREES"
)
};
...
...
@@ -387,15 +331,9 @@ static char *help_cos = {
"The COS function returns the cosine of b1, where b1 is "
"given in radians. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
"This function only takes one argument."
"
\n
"
""
""
""
""
"@SEEALSO=COSH, SIN, SINH, TAN, TANH, RADIANS, DEGREES"
)
};
...
...
@@ -411,15 +349,9 @@ static char *help_int = {
"Eqilivent to FLOOR(b1) for b1 >0, amd CEIL(b1) "
"for b1 < 0. "
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
""
"
\n
"
""
""
""
""
"@SEEALSO=FLOOR, CEIL, ABS"
)
};
...
...
@@ -430,15 +362,8 @@ static char *help_count = {
"@DESCRIPTION="
"Returns the total number of arguments passed."
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
""
"
\n
"
""
""
""
""
"@SEEALSO=AVERAGE"
)
};
...
...
@@ -450,15 +375,9 @@ static char *help_fact = {
"@DESCRIPTION="
"Computes the factorial of b1. ie, b1!"
"
\n
"
"Performing this function on a string or empty cell returns an error"
""
"
\n
"
"`Factorials were someone's attempt to make math *look* exciting. ` --Steven Wright "
""
""
""
"@SEEALSO="
)
};
...
...
@@ -471,15 +390,8 @@ static char *help_exp = {
"Computes the value of e(the base of natural logarithmns) raised "
"to the power of b1. "
"
\n
"
"Performing this function on a string or empty cell returns an error."
""
"
\n
"
""
""
""
""
"@SEEALSO=LOG, LOG2, LOG10"
)
};
...
...
@@ -490,15 +402,8 @@ static char *help_log = {
"@DESCRIPTION="
"Computes the natural logarithm of b1. "
"
\n
"
"Performing this function on a string or empty cell returns an error. "
""
"
\n
"
""
""
""
""
"@SEEALSO=EXP, LOG2, LOG10"
)
};
...
...
@@ -511,13 +416,7 @@ static char *help_log10 = {
"
\n
"
"Performing this function on a string or empty cell returns an error. "
""
"
\n
"
""
""
""
""
"@SEEALSO=EXP, LOG2, LOG"
)
};
...
...
@@ -528,15 +427,8 @@ static char *help_log2 = {
"@DESCRIPTION="
"Computes the base-2 logarithm of b1. "
"
\n
"
"Performing this function on a string or empty cell returns an error. "
""
"
\n
"
""
""
""
""
"@SEEALSO=EXP, LOG10, LOG"
)
};
...
...
@@ -550,15 +442,8 @@ static char *help_min = {
"that has the smallest value. With negative numbers considered "
"smaller than positive numbers."
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
""
"
\n
"
""
""
""
""
"@SEEALSO=MAX,ABS"
)
};
...
...
@@ -571,19 +456,30 @@ static char *help_max = {
"that has the largest value. With negative numbers considered "
"smaller than positive numbers."
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
""
"
\n
"
""
""
""
""
"@SEEALSO=MIN,ABS"
)
};
static
char
*
help_or
=
{
N_
(
"@FUNCTION=OR"
"@SYNTAX=OR(b1, b2, ...)"
"@DESCRIPTION="
"Implements the logical OR function: the result is TRUE if any of the"
"values evaluated to TRUE.
\n
"
"b1, trough bN are expressions that should evaluate to TRUE or FALSE."
"If an integer or floating point value is provided zero is considered"
"FALSE and anything else is TRUE.
\n
"
"If the values contain strings or empty cells those values are "
"ignored. If no logical values are provided, then the error '#VALUE!'"
"is returned.
\n
"
"@SEEALSO=AND"
)
};
static
char
*
help_radians
=
{
N_
(
"@FUNCTION=RADIANS"
"@SYNTAX=RADIANS(b1)n"
...
...
@@ -594,13 +490,8 @@ static char *help_radians = {
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
""
"
\n
"
""
""
""
""
"@SEEALSO=PI,DEGREES"
)
};
...
...
@@ -614,13 +505,8 @@ static char *help_degrees = {
"
\n
"
"Performing this function on a string or empty cell simply does nothing. "
""
"
\n
"
""
""
""
""
"@SEEALSO=RADIANS, PI"
)
};
...
...
@@ -633,8 +519,6 @@ static char *help_sum = {
"argument list. "
"
\n
"
""
"@SEEALSO=AVERAGE, COUNT"
)
};
...
...
@@ -650,12 +534,7 @@ static char *help_bin2dec = {
"Performing this function on a string or empty cell simply does nothing."
"
\n
"
""
""
""
""
"@SEEALSO="
)
"@SEEALSO=DEC2BIN"
)
};
...
...
@@ -670,11 +549,6 @@ static char *help_pi = {
"Performing this function on a string or empty cell"
"returns an error. This function is called with no arguments."
"
\n
"
""
""
""
""
"@SEEALSO="
)
};
...
...
@@ -689,8 +563,6 @@ static char *help_floor = {
"Performing this function on a string or empty cell simply does nothing."
"
\n
"