%function str = mynum2str(num)
%function str = mynum2str(num,n)
%  n is decimal places of precision
%  n defaults to 8 for doubles
%  n is always 0 for integers
function str = mynum2str(num,n)

if nargin == 1, n = 8; end
if ischar(num), str = num; return, end

form = ['%.' int2str(n) 'f'];
if num - fix(num), str = mydeblank(num2str(num,form));
else str = int2str(num); end
