daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Jan 24th, 2019 68 in 8 hours
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function(num, type){
  2.             var numSplit, int, dec;
  3.            
  4.             num = Math.abs(num).toFixed(2);
  5.  
  6.             numSplit = num.split(".");
  7.            
  8.             int = parseInt(numSplit[0]).toLocaleString();
  9.          
  10.             dec = numSplit[1];
  11.  
  12.             if (type === "inc" && num != 0) {
  13.                 return "+ " + int + "." + dec;
  14.             }
  15.             else if (type === "exp" && num != 0) {
  16.                 return "- " + int + "." + dec;
  17.             }
  18.             else {
  19.                 return int + "." + dec;
  20.             }            
  21.         },
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top