%% Specify Formatting
% Display pi as a floating-point number to a specified precision.

formatSpec = '%.2f';
s = num2str(pi,formatSpec)

% Copyright 2015-2020 The MathWorks, Inc.