Skip to content

Commit 8e38c89

Browse files
committed
Fix negative integers rendered as floats in CSV output
The numeric fallback chain as_u64 -> as_f64 caused negative integers to fail as_u64 and fall through to as_f64, producing "-1.0" instead of "-1". Insert as_i64 between as_u64 and as_f64 to handle negative integers correctly.
1 parent fb91a34 commit 8e38c89

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/commands/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ where
8989
b.to_string()
9090
} else if let Some(n) = fv.as_u64() {
9191
n.to_string()
92+
} else if let Some(n) = fv.as_i64() {
93+
n.to_string()
9294
} else if let Some(n) = fv.as_f64() {
9395
n.to_string()
9496
} else if fv.is_null() {

0 commit comments

Comments
 (0)