Method code for $string.to_number()

[Turn on line numbering]
arg str;

if (str.is_numeric())
    return toint(str);
throw(~nonum, "\"" + str + "\" is not a number.");

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon