Main Content

thirtytwo2dec

Thirty-second quotation to decimal

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 = 2×1

  101.7812
  102.9688

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.

Version History

Introduced before R2006a