#include <codecogs/finance/banking/dollar_decimal.h>
using namespace Finance::Banking;
| double | dollar_decimal (double fracPrice, int frac) Convert a fractional price to a decimal price. | |
| Real | cc_dollar_decimal (Real fracPrice, Integer frac) This function is available as a Microsoft Excel add-in. |
| doubledollar_decimal( | double | fracPrice | |
| int | frac | ) |
#include <stdio.h> #include <codecogs/finance/banking/dollar_decimal.h> int main() { double d = Finance::Banking::dollar_decimal(1.3, 8); printf("The fractional price $1 3/8 as decimal = %.3f\n", d); return 0; }Output
The fractional price $1 3/8 as decimal = 1.375
| fracPrice | is the price, with the value after the decimal being the numerator of the fraction |
| frac | the denominator of the fraction |