countDecimals = function (value) {
  if(Math.floor(value) === value) return 0;
  return value.toString().split(".")[1].length || 0;
  }
convert between metrics (e.g m to km, ms to s, etc.)

@param {String} string
@param {String} param
@returns {String}