Yes, there is a way of achieving this in MATLAB. Anytime you print a double or float using the above syntax, the number will be printed with six decimal places. decimal places getting rid of decimals in matlab. Here is a code that does this: Nora Helmy on 13 Mar 2019. In the above code, \t is used to give a tab space, and \n is used to move the cursor to a new line. FPRINTF %6.2f For more information about format strings , refer to the printf() and fprintf() routines in the documents listed in "References" . It is not currently accepting answers. fprintf places output on the named output stream. The sprintf () function shall place output followed by the null byte, '\0', in consecutive bytes starting at * s; it is the user's responsibility to ensure that enough space is available. fprintf matlab decimal places As far as I can tell, there is no simple usage of *printf in C or MATLAB to correctly print to n sigfigs for all possible values, but %#.3g gets the closest, I think, and is not technically wrong with the trailing decimal with out any digits, but can be confusing when used in a sentence as it looks like a period. This number of decimals is added to the string output size, so don’t neglect the size of the decimal in the width specification. Vote. So, the default number of decimal places for a real number, float or double, is six decimal places. decimal place and ans problem. decimal places Syntax. fare(4,44) output is correct. matlab