Main Content

toquoted

Decimal to fractional conversion

Description

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.

example

Examples

collapse all

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 = 
101.0500

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.

Input Arguments

collapse all

Equity price, specified as a numeric decimal.

Data Types: double

Fractional bases used for quoting equity prices in the United States, specified as a scalar numeric.

Data Types: double

Output Arguments

collapse all

Fractional equivalent, returned as a numeric. For example, bond prices are quoted in fractional form based on a 32nd. If you see the quoted price is 100:05, it means 100 5/32 which is equivalent to 100.15625.

Version History

Introduced before R2006a

See Also