code: public static String numberToString(Number number) throws JsonException {
          if (number == null) {
              throw new JsonException("Number must be non-null");
          }
  
          double doubleValue = number.doubleValue();
  
          // the original returns "-0" instead of "-0.0" for negative zero
          if (number.equals(NEGATIVE_ZERO)) {
              return "-0";
          }
  
          long longValue = number.longValue();
          if (doubleValue == (double) longValue) {
              return Long.toString(longValue);
          }
  
          return number.toString();
      }
docs: Encodes the number as a Json string.
  
  @param number a finite value. May not be {@link Double#isNaN() NaNs} or
  {@link Double#isInfinite() infinities}.