Skip to content

Instantly share code, notes, and snippets.

View avisek's full-sized avatar
👀
Observing

Avisek Das avisek

👀
Observing
  • Planet Earth
View GitHub Profile
@avisek
avisek / round.js
Last active October 7, 2018 18:50
function round(number, places) {
places = Math.max(0, Math.min(places || 0, String(number).split(".")[1].length || 0));
return Math.round(number * Math.pow(10, places)) / Math.pow(10, places);
}