round = function (value, decimals) {
  if (isNaN(value)) { return 0; }

  if (!value) { value = 0; }

  if (!decimals) { decimals = 0; }

  return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals);
}
Rounds a number using Math.round

@example
'{{ 1234.56 | round(0) }}'
this.$options.filters.round(1234.56, 0);

@param {number} value  The number to round
@param {int} decimals  The number of decimals to preserve, default = 0
@returns {decimal}     The number rounded to the requested number of decimal places