DocumentationHelp Center
Decimal currency values to fractional values
Fraction = cur2frac(Decimal,Denominator)
example
Fraction = cur2frac(Decimal,Denominator) converts decimal currency values to fractional values. Fraction is returned as a character vector.
Fraction
Decimal
Denominator
collapse all
This example shows how to convert decimal currency values to fractional values.
Fraction = cur2frac(12.125, 8)
Fraction = '12.1'
Decimal currency value, specified as a scalar or vector using numeric decimal values.
Data Types: double
double
Denominator of the fractions, specified as a scalar or vector using numeric values for the denominator.
Fractional values, returned as a character vector or cell array of character vectors.
cur2str | frac2cur
cur2str
frac2cur
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office