docs: public static Number parseDecimal(String text) {
          text = text.replace("_", "");
          int length = text.length();
  
  
          //
          // Strip off any type specifier and convert it to lower
          // case, if present.
  
          char type = 'x';
          if (isNumericTypeSpecifier(text.charAt(length - 1), true)) {
              type = Character.toLowerCase(text.charAt(length - 1));
              text = text.substring(0, length - 1);
          }
  
          //
          // Build the specified type or default to BigDecimal
  
          BigDecimal value = new BigDecimal(text);
          switch (type) {
              case 'f':
                  if (value.compareTo(MAX_FLOAT) <= 0 && value.compareTo(MIN_FLOAT) >= 0) {
                      return Float.parseFloat(text);
                  }
                  throw new NumberFormatException("out of range");
  
              case 'd':
                  if (value.compareTo(MAX_DOUBLE) <= 0 && value.compareTo(MIN_DOUBLE) >= 0) {
                      return Double.parseDouble(text);
                  }
                  throw new NumberFormatException("out of range");
  
              case 'g':
              default:
                  return value;
          }
      }