%% Display Tick Labels in Dollars
% Display x-axis tick labels in dollars with and without decimal values.
% Create a bar chart. Display the tick labels along the x-axis in dollars.

x = 0:20:100;
y = [88 67 98 43 45 65];
bar(x,y)
xtickformat('usd')

%
% Query the tick label format. MATLAB® returns the format as a character vector containing the formatting operators.

fmt = xtickformat

%
% Display the tick labels with no decimal values by tweaking the numeric format to use a precision value of 0 instead of 2.

xtickformat('$%,.0f')

%
% Copyright 2012 The MathWorks, Inc.