code: public static NumberData round(SoyValue value, int numDigitsAfterPoint) {
      // NOTE: for more accurate rounding, this should really be using BigDecimal which can do correct
      // decimal arithmetic.  However, for compatibility with js, that probably isn't an option.
      if (numDigitsAfterPoint == 0) {
        return IntegerData.forValue(round(value));
      } else if (numDigitsAfterPoint > 0) {
        double valueDouble = value.numberValue();
        double shift = Math.pow(10, numDigitsAfterPoint);
        return FloatData.forValue(Math.round(valueDouble * shift) / shift);
      } else {
        double valueDouble = value.numberValue();
        double shift = Math.pow(10, -numDigitsAfterPoint);
        return IntegerData.forValue((int) (Math.round(valueDouble / shift) * shift));
      }
    }
docs: Rounds the given value to the closest decimal point left (negative numbers) or right (positive
  numbers) of the decimal point