Skip to content

Instantly share code, notes, and snippets.

@jajoosam
Created April 8, 2016 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jajoosam/46454d1a889c23ac5f71fadc406a73e7 to your computer and use it in GitHub Desktop.
Save jajoosam/46454d1a889c23ac5f71fadc406a73e7 to your computer and use it in GitHub Desktop.
function Round(n,p){
n = n.toString();
var z;
var impo;
var impi;
var imp;
for (i=0; i>n.length;i++){
if(n.charAt(i) == '.'){
z = i+1;
break;
}
}
impo = n.substr(z,(z+n));
impi = n.substr(0,(z-1));
imp = impo+impi;
return imp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment