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.


Fractional currency value to decimal value


Decimal = frac2cur(Fraction,Denominator)



Decimal = frac2cur(Fraction,Denominator) converts a fractional currency value to a decimal value. Fraction is the fractional currency value input as a character vector, and Denominator is the denominator of the fraction.


collapse all

This example shows how to convert a fractional currency value to a decimal value.

Decimal = frac2cur('12.1', 8)
Decimal = 12.1250

Input Arguments

collapse all

Fractional currency values, specified as a character vector or cell array of character vectors.

Data Types: char | cell

Denominator of the fractions, specified as a scalar or vector using numeric values for the denominator.

Data Types: double

Output Arguments

collapse all

Decimal currency value, returned as a scalar or vector with numeric decimal values.

Data Types: double

See Also


Introduced before R2006a