Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright (c) 2012 [iPs]TeaM
- * Bruno da Silva (contato@brunodasilva.com)
- * Pegar o número de dígitos de um determinado número sem ter de transforma-lo em strings. Eficiente
- Ex :
- f(384438) = 6
- f(73734) = 5
- f(7548878) = 7
- * www.brunodasilva.com
- * www.ips-team.forumeiros.com
- */
- function lengthNumber(n) {
- return Math.round(Math.log(Math.abs(n)+1) / 2)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement