code: public static <T extends Number> String str(T x, DecimalFormat formatter) {
          if (Double.isNaN(x.doubleValue())) {
              return "nan";
          }
          if (Double.isInfinite(x.doubleValue())) {
              return isLt(x.doubleValue(), 0.0) ? "-inf" : "inf";
          }
          return formatter.format(x);
      }
docs: Returns a string representation of the given value
  
  @tparam T determines the class type of the value
  @param x is the value
  @param formatter is the decimal formatter of scalar values
  @return a string representation of the given value