I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
get GPL
COST (GBP)
this unit 1.87
sub units 0.00
+
0
FinanceBanking

dollar fraction

Finance functions
Controller: CodeCogs

Interface

C++
Excel

Dollar Fraction

 
doubledollar_fractiondoubledecPrice
intfrac )
Converts a decimal price to a fractional price, using the following equation:

where <em>iprice</em> is the integer part of <em>decimalPrice</em> and <em>ifrac</em> is the integer part of <em>log(fraction)</em>

Example 1

#include <stdio.h>
#include <codecogs/finance/banking/dollar_fraction.h>
 
int main()
{
  double d = Finance::Banking::dollar_fraction(1.38, 8);
  printf("The decimal price $1.38 as fractional (8 denominator) = %.1f\n", d);
  return 0;
}
Output:
The decimal price $1.38 as fractional (8 denominator) = 1.3

Parameters

decPriceis the decimal price.
fracis the denominator required for the fraction output.

Authors

James Warren (April 2005)
Source Code

Source code is available when you agree to a GP Licence or buy a Commercial Licence.

Not a member, then Register with CodeCogs. Already a Member, then Login.