1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

atof implementation in V

This commit is contained in:
penguindark
2019-12-16 23:07:13 +01:00
committed by Alexander Medvednikov
parent 5a56ca0892
commit 3dbf7a4039
4 changed files with 683 additions and 2 deletions

View File

@ -298,11 +298,13 @@ pub fn (s string) i64() i64 {
}
pub fn (s string) f32() f32 {
return C.atof(charptr(s.str))
//return C.atof(charptr(s.str))
return f32(strconv.atof64(s))
}
pub fn (s string) f64() f64 {
return C.atof(charptr(s.str))
//return C.atof(charptr(s.str))
return strconv.atof64(s)
}
pub fn (s string) u32() u32 {