Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Função similar a toFixed. O parametro P indica quantas casas decimais você quer dado o valor i
- // f(15.488389678834183438, 2) = 15.48
- //
- function getFixed(i, p) {
- return p = Math.pow(10, p), Math.floor(i * p) / p
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement