Skip to content

Instantly share code, notes, and snippets.

View WebDevStu's full-sized avatar

Stewart Anderson WebDevStu

  • Yorkshire
View GitHub Profile
@pdscopes
pdscopes / calcRangePrecision.js
Last active August 11, 2016 11:35
Javascript calculate the toFixed precision for a given range
/**
* Calculates the toFixed precision required for nicely displaying
* step intervals between the values given.
*
* @param int min Minimum value in set
* @param int max Maximum value in set
*
* @return int Number.toFixed precision
*/
function calcRangePrecision(min, max) {