Decimal to thirty-second quotation
[OutNumber, Fractions] = dec2thirtytwo(InNumber, Accuracy)
Input number as a decimal fraction.
(Optional) Rounding. Default = 1, round down to nearest thirty second. Other values are 2 (nearest half), 4 (nearest quarter) and 10 (nearest decile).
[OutNumber, Fractions] = dec2thirtytwo(InNumber, Accuracy) changes
a decimal price quotation for a bond or bond future to a fraction
with a denominator of 32.
downward to the closest integer.
Fractions is the fractional part in units
of thirty-second with accuracy as prescribed by the input
This example shows two bonds that are quoted with decimal prices of 101.78 and 102.96. These prices are converted to fractions with a denominator of 32.
InNumber = [101.78; 102.96]; [OutNumber, Fractions] = dec2thirtytwo(InNumber)
OutNumber = 101 102 Fractions = 25 31