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

encoding.csv: handle bools (#15103)

This commit is contained in:
Ken
2022-07-17 16:54:36 +09:00
committed by GitHub
parent b4dedcae43
commit 3075e35237
2 changed files with 18 additions and 18 deletions

View File

@@ -46,11 +46,12 @@ pub fn decode<T>(data string) []T {
fn string_to_bool(val string) bool {
l_val := val.to_lower().trim_space()
i_val := val.int()
if l_val == 'true' {
return true
}
if i_val == 1 {
i_val := val.int()
if i_val != 0 {
return true
}