How can num2str function cut off some digits in Matlab?

237 Views Asked by At

I am reading the book " MATLAB: A practical introductoin programming and problem solving", written by Stormy Attaway and getting curious with the function "num2str".

On page 256, the author used the following steps to convert a number into a string

str2 = num2str(3.456789)

str2=

3.4568

Why are the digits 7 and 9 obmitted? In general, how can we know what the obmitted digits are?

Thank you for your help.