code: protected void checkNumber(Number number) {
          Objects.requireNonNull(number, "Number is required.");
          // numeric check for overflow...
          if (number.longValue() > MAX_BD.longValue()) {
              throw new ArithmeticException("Value exceeds maximal value: " + MAX_BD);
          }
          BigDecimal bd = MoneyUtils.getBigDecimal(number);
          if (bd.precision() > MAX_BD.precision()) {
              throw new ArithmeticException("Precision exceeds maximal precision: " + MAX_BD.precision());
          }
          if (bd.scale() > SCALE) {
              String val = MonetaryConfig.getConfig()
                      .get("org.javamoney.moneta.FastMoney.enforceScaleCompatibility");
              if(val==null){
                  val = "false";
              }
              if (Boolean.parseBoolean(val)) {
                  throw new ArithmeticException("Scale of " + bd + " exceeds maximal scale: " + SCALE);
              } else {
                  if (LOG.isLoggable(Level.FINEST)) {
                      LOG.finest("Scale exceeds maximal scale of FastMoney (" + SCALE +
                              "), implicit rounding will be applied to " + number);
                  }
              }
          }
      }
docs: Internal method to check for correct number parameter.
  
  @param number the number to be checked, including null..
  @throws NullPointerException          If the number is null
  @throws java.lang.ArithmeticException If the number exceeds the capabilities of this class.