ConvertRate function
Syntax
ConvertRate(Rate, In_Frequency, Out_Frequency)
Description
Use the ConvertRate function to convert a rate between various compounding frequencies.
Parameters
| Parameter | Description |
|---|---|
|
Rate |
The rate to be converted. This parameter takes a number value. |
|
In_Frequency |
The frequency of the rate to be converted from. This parameter takes an array of number, with two elements. The first element is periodicity, (for example, if you chose daily compounding, 1 would represent daily while 7 would represent weekly.) The second element is the unit of measure of frequency. The values for the second element are: |
| Value | Description |
|---|---|
|
0 |
continuous compounding |
|
1 |
daily compounding |
|
2 |
monthly compounding |
|
3 |
yearly compounding |
| Parameter | Description |
|---|---|
|
Out_Frequency |
The frequency of the rate to be converted to. This parameter takes an array of number, with two elements. The first element is periodicity, (for example, if you chose daily compounding, 1 would represent daily while 7 would represent weekly.) The second element is the unit of measure of frequency. The values for the second element are: |
| Value | Description |
|---|---|
|
0 |
continuous compounding |
|
1 |
daily compounding |
|
2 |
monthly compounding |
|
3 |
yearly compounding |
Returns
A number representing the converted rate.
Example
The following example converts the specified values from days to years.
Local array of number &In, &Out;
Local number &rate, &NewRate;
&rate = 0.01891;
&In = CreateArray(0, 0);
&In[1] = 1; /* daily */
&In[2] = 1; /* compound_days */
&Out = CreateArray(0, 0);
&Out[1] = 1; /* one year */
&Out[2] = 3; /* compound_years */
&NewRate = ConvertRate(&rate, &In, &Out);
Related Topics