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.


Bank-formatted text


BankText = cur2str(Value,Digits)



BankText = cur2str(Value,Digits) returns the given value in bank format.

The output format for BankText 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.


collapse all

Return bank formatted text for a negative numeric value.

BankText = cur2str(-826444.4456,3)   
BankText = 
% Negative numbers are displayed in parentheses.

Input Arguments

collapse all

Value to be formatted, specified as a numeric value.

Data Types: double

Number of significant digits, specified as an integer. A negative Digits rounds the value to the left of the decimal point.

Data Types: double

Output Arguments

collapse all

Bank-formatted text (BankText) is returned as a character vector with a leading dollar sign ($). Negative numbers are displayed in parentheses.

See Also


Introduced before R2006a