Main Content


Fractional currency value to decimal value



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

Version History

Introduced before R2006a

See Also