num2cash

버전 1.0.0 (2.47 KB) 작성자: Paul Shoemaker
Convert numbers to currency arrays
다운로드 수: 57
업데이트 날짜: 2018/7/21

라이선스 보기

% Converts numbers to currency unit character arrays
%
% NUM2CASH(AMOUNT) will convert the numeric AMOUNT (array or scalar) into a
% string with dollars and commas (e.g. AMOUNT=2500 is returned as $2,500.00).
%
% The formatting of the returned values can be configured using various
% NAME-VALUE pairs, as described below.
%
% - 'showDecimals' : Boolean flag that determinesif fractional values
% will be shown or if they'll be ROUNDED to the nearest
% whole currency unit. If set to TRUE then two decimal
% places will be shown for all values, including
% integer values. TRUE by default.
%
% - 'showParens' : Many accounting methods use parentheses to denote
% negative currency quantities. This boolean flag
% determines whether parentheses are used to denote
% negative values (e.g. negative $13 shown as ($13))
% or if a negative sign is used (e.g. negative $13
% shown as -$13). TRUE by default.
%
% - 'showSymbol' : Some users may just want to see numbers with comma
% separators and decimals without currency units. This
% boolean flag allows the user to turn currency unit
% display on or off. TRUE (on) by default.
%
% - 'currencySymbol': The user can specify any currency symbol, such as
% dollars ('$'), Euros (char(8364)), Yen or Yuan (char(165)),
% or British Pounds (char(163), as examples. Default
% value is dollars ('$').
%
% Example(s):
%
% numValues = [pi/8 pi -pi 10000*pi];
% strValues = num2cash(numValues,'showDecimals',true);

인용 양식

Paul Shoemaker (2024). num2cash (https://www.mathworks.com/matlabcentral/fileexchange/68283-num2cash), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2018a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Data Preprocessing에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0