This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Decimal to fractional conversion


quote = toquoted(usddec,fracpart)


quote = toquoted(usddec,fracpart) returns the fractional equivalent, quote, of the decimal figure, usddec, based on the fractional base (denominator), fracpart. The fractional bases are the ones used for quoting equity prices in the United States (denominator 2, 4, 8, 16, or 32). If fracpart is not entered, the denominator 32 is assumed.


A United States equity price in decimal form is 101.625. To convert this to fractional form in eighths of a dollar:

quote = toquoted(101.625, 8)
quote =

The answer is interpreted as 101 5/8.


The convention of using . (period) as a substitute for : (colon) in the output is adopted from Excel® software.

Introduced before R2006a