matlab - Converting a floating point number to string -


i want convert floating point number string.

f=0.0000 str=num2str(f,4); 

this give me this-

str= 0 

but wanted keep result till 4 decimal points.i understand using num2str(f,4) results in precision of maximum 4 significant digits after decimal.it not equal 4 maximum , why answer.i want know there way convert number string 4 significant digits after decimal point?

try using sprintf instead:

str = sprintf('%.4f', f) 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -