When does Lang.String.toNumberWithBase() return Null?

Lang.String.toNumberWithBase()   can return Null, but the API documentation doesn't mention under what conditions this will occur.

When does it return Null?

  • The docs could def be clearer (and more explicit), but I assume it would return null in the same circumstances that String.toNumber() would (if it’s unable to convert the string to a Number).

    Convert a String to a Number.

    If a String is in the numeric form of "123", it can be converted to a Number. Additional characters after the detected number value will be ignored. Strings that cannot be interpreted as a Number, or whose value exceeds that which can be represented in a Number, will result in a null value.

  • probably when string can't be converted to number - see toNumber() desc.