JavaScript displaying a float to 2 decimal places September 17, 2022 by Tarik float_num.toFixed(2); Note:toFixed() will round or pad with zeros if necessary to meet the specified length.