Truncating Numbers in JavaScript
I needed a function to truncate a number. Math.floor() worked … until I tried it on a negative number. So I had to write my own truncate function. Even though I needed to truncate numbers to the integer portion only, I figured sooner or later I would need to truncate to a given number of… Read More »