asDecimal

asDecimal(precision:     Integer;
          decimalPlaces: Integer): Decimal;

The asDecimal method of the Decimal primitive type returns the receiver as a Decimal with the length and scale factor specified by the values of the precision and decimalPlaces parameters, respectively.

You can use this method to convert a Decimal value returned by a method to a format with the specified precision and decimal places. If you reduce the number of decimal places, rounding occurs. If the receiver value overflows the specified precision, an exception is raised.