function toP5String(obj) {
      if(obj instanceof String) {
        return obj;
      }
      if(typeof obj === 'number') {
        // check if an int
        if(obj === (0 | obj)) {
          return obj.toString();
        }
        return p.nf(obj, 0, 3);
      }
      if(obj === null || obj === undef) {
        return "";
      }
      return obj.toString();
    }
/**
     * toP5String converts things with arbitrary data type into
     * string values, for text rendering.
     *
     * @param {any} any object that can be converted into a string
     *
     * @return {String} the string representation of the input
     */
toP5String converts things with arbitrary data type into
string values, for text rendering.

@param {any} any object that can be converted into a string

@return {String} the string representation of the input
toP5String converts things with arbitrary data type into string values for text rendering . @param { any } any object that can be converted into a string @return { String } the string representation of the input
function toP5String(obj) {
      if(obj instanceof String) {
        return obj;
      }
      if(typeof obj === 'number') {
        if(obj === (0 | obj)) {
          return obj.toString();
        }
        return p.nf(obj, 0, 3);
      }
      if(obj === null || obj === undef) {
        return "";
      }
      return obj.toString();
    }
function toP5String ( obj ) { if ( obj instanceof String ) { return obj ; } if ( typeof obj === 'number' ) { if ( obj === ( 0 | obj ) ) { return obj . toString ( ) ; } return p . nf ( obj , 0 , 3 ) ; } if ( obj === null || obj === undef ) { return "" ; } return obj . toString ( ) ; }
toP5String converts things with arbitrary data type into
 string values, for text rendering.
toP5String converts things with arbitrary data type into string values for text rendering .
// check if an int