financebanking

dollar decimal

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

Interface

#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.
Click for details on using CodeCogs in ExcelReal cc_dollar_decimal (Real fracPrice, Integer frac)
This function is available as a Microsoft Excel add-in.

Function Documentation

Dollar Decimal Calculator

  

Add calculator to your site or email
 
doubledollar_decimaldoublefracPrice
intfrac )
Converts a fractional price to a decimal price.

Fractional to decimal conversion is done using the following equation:
(1)
\displaystyle iprice+(fractionalPrice-iprice) \frac{10^{(ifrac+1)}}{fraction}

where iprice is the integer part of fractionalPrice and ifrac is the integer part of log(fraction)
Example:
  #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
Parameters:
fracPriceis the price, with the value after the decimal being the numerator of the fraction
fracthe denominator of the fraction
Returns:
a double representing the decimal price
Authors:
James Warren (April 2005)
Source Code:
Register

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


Last Modified: 3 Jan 08 @ 09:59     Page Rendered: 2008-05-09 18:35:34

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional