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

strconv: fix on ftoa string decimal aproximation, 'nan' string fix

This commit is contained in:
penguindark
2020-03-26 22:39:46 +01:00
committed by GitHub
parent 9185de3fb7
commit 8de027c4b4
4 changed files with 75 additions and 27 deletions

View File

@ -165,4 +165,8 @@ fn test_float_to_str(){
//println(b)
assert b.len == exp + 2
}
// test rounding str conversion
assert f64_to_str(0.3456789123456, 4)=="3.4568e-01"
assert f32_to_str(0.345678, 3)=="3.457e-01"
}