code: public static Number getExactlyNumber(final String value, final int radix) {
          try {
              return getBigInteger(value, radix);
          } catch (final NumberFormatException ex) {
              return new BigDecimal(value);
          }
      }
docs: Get exactly number value and type.
  
  @param value string to be converted
  @param radix radix
  @return exactly number value and type