Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

cur2str

Bank-formatted text

Syntax

BankText = cur2str(Value,Digits)

Description

example

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.

Examples

collapse all

Return bank formatted text for a negative numeric value.

BankText = cur2str(-826444.4456,3)   
BankText = 
'($826444.446)'
% 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

Was this topic helpful?