%% Specify Number of Digits
% Specify the number of base-12 digits that dec2base returns. If you specify more digits than are required, then dec2base pads the output with leading zeros.

D = 23;
baseStr = dec2base(D,12,6)

%
% If you specify fewer digits, then dec2base still returns as many digits as required to represent the input number.

baseStr = dec2base(D,12,1)

% Copyright 2019 The MathWorks, Inc.