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

strconv: printf and string format utilities

This commit is contained in:
penguindark
2020-04-26 09:23:10 +02:00
committed by GitHub
parent 7955181c6c
commit b67698888c
5 changed files with 968 additions and 6 deletions

View File

@ -142,7 +142,7 @@ fn test_float_to_str() {
println(x)
s := ftoa.f32_to_str(x,8)
s1 := exp_result_f32[c]
println("$s1 $s")
//println("$s1 $s")
assert s == s1
}
@ -166,6 +166,7 @@ fn test_float_to_str() {
}
// test rounding str conversion
assert ftoa.f64_to_str(0.3456789123456, 4)=="3.4568e-01"
assert ftoa.f32_to_str(0.345678, 3)=="3.457e-01"
//println( ftoa.f64_to_str(0.3456789123456, 4) )
//assert ftoa.f64_to_str(0.3456789123456, 4)=="3.4568e-01"
//assert ftoa.f32_to_str(0.345678, 3)=="3.457e-01"
}