Add a fromString static method on Num that converts strings to numbers.

This commit is contained in:
Gavin Schulz
2015-02-22 20:06:17 -08:00
parent a9d9362e29
commit 03a5b96040
4 changed files with 34 additions and 2 deletions
+7
View File
@@ -90,3 +90,10 @@ It is a runtime error if `other` is not a number.
### **...**(other) operator
**TODO**
### Num.**fromString**(value)
Attempts to parse `value` as a decimal literal and return it as an instance of
`Num`. If the number cannot be parsed `null` will be returned.
It is a runtime error if `value` is not a string.