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

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

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