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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user