Cast result object to a string.

@return "NaN" if the number is NaN, Infinity or -Infinity if
the number is infinite or the string value of the number.
481630
public String str()
  {

    if (Double.isNaN(m_val))
    {
      return "NaN";
    }
    else if (Double.isInfinite(m_val))
    {
      if (m_val > 0)
        return "Infinity";
      else
        return "-Infinity";
    }

    double num = m_val;
    String s = Double.toString(num);
    int len = s.length();

    if (s.charAt(len - 2) == '.' && s.charAt(len - 1) == '0')
    {
      s = s.substring(0, len - 2);

      if (s.equals("-0"))
        return "0";

      return s;
    }

    int e = s.indexOf('E');

    if (e < 0)
    {
      if (s.charAt(len - 1) == '0')
        return s.substring(0, len - 1);
      else
        return s;
    }

    int exp = Integer.parseInt(s.substring(e + 1));
    String sign;

    if (s.charAt(0) == '-')
    {
      sign = "-";
      s = s.substring(1);

      --e;
    }
    else
      sign = "";

    int nDigits = e - 2;

    if (exp >= nDigits)
      return sign + s.substring(0, 1) + s.substring(2, e)
             + zeros(exp - nDigits);

    // Eliminate trailing 0's - bugzilla 14241
    while (s.charAt(e-1) == '0')
      e--;
         
    if (exp > 0)
      return sign + s.substring(0, 1) + s.substring(2, 2 + exp) + "."
             + s.substring(2 + exp, e);

    return sign + "0." + zeros(-1 - exp) + s.substring(0, 1)
           + s.substring(2, e);
  }
475899
@Override
    public NumberType getNumberType() throws IOException {
        Object n = currentNode();
        if (n instanceof Integer) {
            return NumberType.INT;
        } else if (n instanceof BigInteger) {
            return NumberType.BIG_INTEGER;
        } else if (n instanceof BigDecimal) {
            return NumberType.BIG_DECIMAL;
        } else if (n instanceof Double) {
            return NumberType.DOUBLE;
        } else if (n instanceof Float) {
            return NumberType.FLOAT;
        } else if (n instanceof Long) {
            return NumberType.LONG;
        } else {
            throw _constructError(n + " is not a number");
        }
    }
1060922
private static Object toNumber( String value)
    {
    Object number;

    try
      {
      number = toExternalNumber( new BigDecimal( value));
      }
    catch( Exception e)
      {
      number = null;
      }

    return number;
    }
920111
public static String stringFor(int result)
    {
        switch (result)
        {
            case NVRTC_SUCCESS                                     : return "NVRTC_SUCCESS";
            case NVRTC_ERROR_OUT_OF_MEMORY                         : return "NVRTC_ERROR_OUT_OF_MEMORY";
            case NVRTC_ERROR_PROGRAM_CREATION_FAILURE              : return "NVRTC_ERROR_PROGRAM_CREATION_FAILURE";
            case NVRTC_ERROR_INVALID_INPUT                         : return "NVRTC_ERROR_INVALID_INPUT";
            case NVRTC_ERROR_INVALID_PROGRAM                       : return "NVRTC_ERROR_INVALID_PROGRAM";
            case NVRTC_ERROR_INVALID_OPTION                        : return "NVRTC_ERROR_INVALID_OPTION";
            case NVRTC_ERROR_COMPILATION                           : return "NVRTC_ERROR_COMPILATION";
            case NVRTC_ERROR_BUILTIN_OPERATION_FAILURE             : return "NVRTC_ERROR_BUILTIN_OPERATION_FAILURE";
            case NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION : return "NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION";
            case NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION   : return "NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION";
            case NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID             : return "NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID";
            case NVRTC_ERROR_INTERNAL_ERROR                        : return "NVRTC_ERROR_INTERNAL_ERROR";
            case JCUDA_INTERNAL_ERROR                              : return "JCUDA_INTERNAL_ERROR";
        }
        return "INVALID nvrtcResult: "+result;
    }
414497
function(obj) {
		if(obj === null) { return 'null'; }

		if(obj === undefined) { return 'undefined'; }

		var ret = Object.prototype.toString.call(obj).match(/^\[object\s+(.*?)\]$/)[1];

		ret = ret? ret.toLowerCase() : '';

		if(ret == 'number' && isNaN(obj)) {
			return 'NaN';
		}

		return ret;
	}
966533
public Float asFloatObj() {
		if (current == null)
			return null;
		if (current instanceof Number) {
			if (current instanceof Float)
				return (Float) current;
			return Float.valueOf(((Number) current).floatValue());
		}
		return Float.NaN;
	}
91936
def type(self):
        """"""
        if isinstance(self.value, numbers.Number):
            return "number"
        if isinstance(self.value, basestring):
            return "string"
        return "unknown"
74185
public static Number toNumber(String string) {
    BigDecimal value = new BigDecimal(string);
    try {
      long l = value.longValueExact();
      int i = (int) l;
      if ((long) i == l) {
        return i;
      } else {
        return l;
      }
    } catch (ArithmeticException e) {
      double d = value.doubleValue();
      if (BigDecimal.valueOf(d).equals(value)) {
        float f = (float) d;
        if ((double) f == d) {
          return (float) d;
        } else {
          return d;
        }
      } else {
        return null;
      }
    }
  }
765070
public static String objectToString(Object value) {
    if (value == null) {
      return null;
    }
    if (value instanceof String) {
      return (String)value;
    }
    if (value instanceof String[]) {
      return StringUtils.join(encodeString((String[])value), ARRAY_DELIMITER);
    }
    else if (value instanceof Integer) {
      return Integer.toString((Integer)value);
    }
    else if (value instanceof Long) {
      return Long.toString((Long)value);
    }
    else if (value instanceof Double) {
      return Double.toString((Double)value);
    }
    else if (value instanceof Boolean) {
      return Boolean.toString((Boolean)value);
    }
    else if (value instanceof Map) {
      Map<?, ?> map = (Map<?, ?>)value;
      StringBuilder stringValue = new StringBuilder();
      Map.Entry<?, ?>[] entries = Iterators.toArray(map.entrySet().iterator(), Map.Entry.class);
      for (int i = 0; i < entries.length; i++) {
        Map.Entry<?, ?> entry = entries[i];
        String entryKey = encodeString(Objects.toString(entry.getKey(), ""));
        String entryValue = encodeString(Objects.toString(entry.getValue(), ""));
        stringValue.append(entryKey).append(KEY_VALUE_DELIMITER).append(entryValue);
        if (i < entries.length - 1) {
          stringValue.append(ARRAY_DELIMITER);
        }
      }
      return stringValue.toString();
    }
    throw new IllegalArgumentException("Unsupported type: " + value.getClass().getName());
  }
621296
public static String typeof(Object value)
    {
        if (value == null)
            return "object";
        if (value == Undefined.instance)
            return "undefined";
        if (value instanceof ScriptableObject)
            return ((ScriptableObject) value).getTypeOf();
        if (value instanceof Scriptable)
            return (value instanceof Callable) ? "function" : "object";
        if (value instanceof CharSequence)
            return "string";
        if (value instanceof Number)
            return "number";
        if (value instanceof Boolean)
            return "boolean";
        throw errorWithClassName("msg.invalid.type", value);
    }
313611
def get_number(s, cast=int):
    
    import string
    d = "".join(x for x in str(s) if x in string.digits)
    return cast(d)
612219
public static final Function<Double,String> toCurrencyStr() {
        return (Function<Double,String>)((Function)FnNumber.toCurrencyStr());
    }
1042787
function castNumberToString(pageNumber?: number | string): string {
  if (typeof pageNumber === 'number') {
    return String(pageNumber);
  }

  if (typeof pageNumber === 'string') {
    return pageNumber;
  }

  if (
    typeof pageNumber !== 'string' ||
    typeof pageNumber !== 'number'
  ) {
    throw new Error('Unexpected page number type');
  }

  throw new Error(`Unable to cast ${pageNumber} to string`);
}
1142955
public JcNumber toFloat() {
		JcNumber ret = new JcNumber(null, this,
				new FunctionInstance(FUNCTION.Common.TOFLOAT, 1));
		QueryRecorder.recordInvocationConditional(this, "toFloat", ret);
		return ret;
	}
257815
public String getString() 
    {
        String string = Constants.BLANK;
        NumberField numberField = (NumberField)this.getField();
        if (this.getNextConverter().getLength() != 0)
        {
            double dValue = this.getValue();
            if (dValue != 0)
                dValue = 1 / dValue;
            if (m_mfRecip == null)
                m_mfRecip = NumberFormat.getInstance();
            m_mfRecip.setMinimumFractionDigits(numberField.getScale());
            m_mfRecip.setMaximumFractionDigits(numberField.getScale());
            string = m_mfRecip.format(dValue);
        }
        return string;
    }
662137
public String getString() 
    {
        String string = super.getString();  // By default, get the data as-is
        if (this.getField() instanceof NumberField)
        {
            double dValue = this.getField().getValue();
            if (m_bDebit)
            {
                if (dValue < 0)
                    string = Constants.BLANK; // For debit/negative, return a null
            }
            else
            {   // Credit
                if (dValue >= 0)
                    string = Constants.BLANK; // For credit/positive, return a null
                else
                    string = ((NumberField)this.getField()).binaryToString(new Double(-dValue));  // Positive representation
            }
        }
        return string;
    }
332579
function () {

// Parse a number value.

            var number,
                string = '';

            if (ch === '-') {
                string = '-';
                next('-');
            }
            while (ch >= '0' && ch <= '9') {
                string += ch;
                next();
            }
            if (ch === '.') {
                string += '.';
                while (next() && ch >= '0' && ch <= '9') {
                    string += ch;
                }
            }
            if (ch === 'e' || ch === 'E') {
                string += ch;
                next();
                if (ch === '-' || ch === '+') {
                    string += ch;
                    next();
                }
                while (ch >= '0' && ch <= '9') {
                    string += ch;
                    next();
                }
            }

            number = +string;

            if (!isFinite(number)) {
                error("Bad number");
            } else {
                
                // means JS rounded or truncated number, too big
                if (number.toString() !== string) {
                    try {
                        return new BigNumber(string);
                    } catch (e) {
                        // if fails, fallback to default behavior
                    }
                }

                return number;
            }
        }