financebanking

dollar fraction

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 1.20
sub units 0.00
add a commercial licence to your cart
0
viewed 1781 times and licensed 11 times
www.codecogs.com/d-ox/finance/banking/dollar_fraction.php
Controller: CodeCogs    Contact Controller

Interface

#include <codecogs/finance/banking/dollar_fraction.h>

using namespace Finance::Banking;

double dollar_fraction (double decPrice, int frac)
Convert a decimal price to a fractional price.
Click for details on using CodeCogs in ExcelReal cc_dollar_fraction (Real decPrice, Integer frac)
This function is available as a Microsoft Excel add-in.

Function Documentation

Dollar Fraction Calculator

  

Add calculator to your site or email
 
doubledollar_fractiondoubledecPrice
intfrac )
Converts a decimal price to a fractional price, using the following equation:
(1)
\displaystyle iprice+\frac{decimalPrice-iprice}{10^{(ifrac+1)}/fraction}

where iprice is the integer part of decimalPrice and ifrac is the integer part of log(fraction)
Example:
#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:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Last Modified: 11 Jan 08 @ 01:11     Page Rendered: 2008-05-09 14:21:45

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional