v / vlib / strconv
Raw file | 12 loc (10 sloc) | 411 bytes | Latest commit hash f6844e976
1module strconv
2
3// atof64 return a f64 from a string doing a parsing operation
4pub fn atof64(s string) !f64 {
5 // TODO: handle parsing invalid numbers as close as possible to the pure V version
6 // that may be slower, but more portable, and will guarantee that higher level code
7 // works the same in the JS version, as well as in the C and Native versions.
8 res := 0.0
9 #res.val = Number(s.str)
10
11 return res
12}