If the text contains invalid characters, zero is returned.
This function can optionally return information about invalid numbers. If text has the form of {sequence, integer} then if the integer is nonzero, a sequence is returned. The first element is the value converted, and the second is the position in the text where conversion stopped. If no errors were found then this is zero.
Notes:
sequence rc atom val rc = TextToNumber({"12.34a", 1}) -- rc ---> {12.34, 6} -- Error at position 6 rc = TextToNumber({"12.34", 1}) -- rc ---> {12.34, 0} -- No errors.val = TextToNumber("12.34a") -- val ---> 0
val = TextToNumber("#f80c") --> 63500 val = TextToNumber("#f80c.7aa") --> 63500.47900390625 val = TextToNumber("@1703") --> 963 val = TextToNumber("!101101") --> 45 val = TextToNumber("12_583_891") --> 12583891 val = TextToNumber("12_583_891%") --> 125838.91 val = TextToNumber("12583891%%") --> 1258.3891