Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

thirtytwo2dec

Thirty-second quotation to decimal

Syntax

  • OutNumber = thirtytwo2dec(InNumber,InFraction)
    example

Description

example

OutNumber = thirtytwo2dec(InNumber,InFraction) changes the price quotation for a bond or bond future from a fraction with a denominator of 32 to a decimal.

Examples

collapse all

This example shows how to change the price quotation for a bond or bond future from a fraction with a denominator of 32 to a decimal, given two bonds that are quoted as 101-25 and 102-31.

InNumber  = [101; 102];
InFraction = [25; 31];

OutNumber = thirtytwo2dec(InNumber, InFraction)
OutNumber =

  101.7812
  102.9688

Related Examples

Input Arguments

collapse all

Input number, specified as a scalar or an N-by-1 vector of integers representing price without the fractional components.

Data Types: double

Fractional portions of each element in InNumber, specified as a scalar or an N-by-1 vector of numeric decimal fractions.

Data Types: double

Output Arguments

collapse all

Output number that represents sum of InNumber and InFraction, returned as a decimal.

Introduced before R2006a

Was this topic helpful?