cur2frac

Decimal currency values to fractional values

Description

example

Fraction = cur2frac(Decimal,Denominator) converts decimal currency values to fractional values. Fraction is returned as a character vector.

Examples

collapse all

This example shows how to convert decimal currency values to fractional values.

Fraction = cur2frac(12.125, 8)
Fraction = 
'12.1'

Input Arguments

collapse all

Decimal currency value, specified as a scalar or vector using numeric decimal values.

Data Types: double

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

Data Types: double

Output Arguments

collapse all

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

See Also

|

Introduced before R2006a