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×1101.7812 - 102.9688

Input Arguments

collapse all

输入数, specified as a scalar or anN-by-1vector of integers representing price without the fractional components.

Data Types:double

Fractional portions of each element inInNumber, specified as a scalar or anN-by-1vector of numeric decimal fractions.

Data Types:double

Output Arguments

collapse all

Output number that represents sum ofInNumberandInFraction, returned as a decimal.

Version History

Introduced before R2006a

See Also