I would like to format my numbers to always display 2 decimal places, rounding where applicable.
Examples:
number display ------ ------- 1
here is another solution to round only using floor, meaning, making sure calculated amount won't be bigger than the original amount (sometimes needed for transactions):
Math.floor(num* 100 )/100;