Documentation Center

  • Trial Software
  • Product Updates

Format Currency

Financial Toolbox™ software provides several functions to format currency and chart financial data. The currency formatting functions are

cur2frac

Converts decimal currency values to fractional values

cur2str

Converts a value to Financial Toolbox bank format

frac2cur

Converts fractional currency values to decimal values

These examples show their use.

Dec = frac2cur('12.1', 8)

returns Dec = 12.125, which is the decimal equivalent of 12-1/8. The second input variable is the denominator of the fraction.

Str =  cur2str(-8264, 2)

returns the string ($8264.00). For this toolbox function, the output format is a numerical format with dollar sign prefix, two decimal places, and negative numbers in parentheses; for example, ($123.45) and $6789.01. The standard MATLAB® bank format uses two decimal places, no dollar sign, and a minus sign for negative numbers; for example, -123.45 and 6789.01.

Was this topic helpful?