alankis

Convert it to REGEXP

Oct 25th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function myPrice(price) {
  2.      price = price.toString();
  3.      return price.substr(0, price.length-2).concat('.', price.substr(-2));
  4.     }
  5.    
  6. myPrice(123456); //1234.56
Advertisement
Add Comment
Please, Sign In to add comment