Advertisement
ipsBruno

(Javascript) integerConcate

Apr 24th, 2012
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. // Pegar 2 números e unir eles.
  3. // Ex:
  4. // f(15, 20) = 1520
  5. // f(10,4815) = 104815
  6. //
  7.  
  8. function integerConcate(n1,n2) {
  9.         return (n1 * Math.round(Math.pow(10, Math.round(Math.log(Math.abs(n2)+1) / 2))) + n2)
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement