From 4e6327de1db06d738afa2c2555bac2c1704a4b20 Mon Sep 17 00:00:00 2001 From: Patrick More <34631716+pjmore@users.noreply.github.com> Date: Fri, 24 Sep 2021 15:47:16 -0600 Subject: [PATCH] Added BigInt handling to the delimited file format for the 'to' command (#4034) Co-authored-by: patrick --- crates/nu-command/src/commands/formats/to/delimited.rs | 3 ++- crates/nu-value-ext/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/nu-command/src/commands/formats/to/delimited.rs b/crates/nu-command/src/commands/formats/to/delimited.rs index bba16a30..2b48d61f 100644 --- a/crates/nu-command/src/commands/formats/to/delimited.rs +++ b/crates/nu-command/src/commands/formats/to/delimited.rs @@ -136,7 +136,8 @@ fn to_string_tagged_value(v: &Value) -> Result { | Primitive::Boolean(_) | Primitive::Decimal(_) | Primitive::FilePath(_) - | Primitive::Int(_), + | Primitive::Int(_) + | Primitive::BigInt(_), ) => as_string(v), UntaggedValue::Primitive(Primitive::Date(d)) => Ok(d.to_string()), UntaggedValue::Primitive(Primitive::Nothing) => Ok(String::new()), diff --git a/crates/nu-value-ext/src/lib.rs b/crates/nu-value-ext/src/lib.rs index 144c3d8b..43e25937 100644 --- a/crates/nu-value-ext/src/lib.rs +++ b/crates/nu-value-ext/src/lib.rs @@ -698,6 +698,7 @@ pub fn as_string(value: &Value) -> Result { UntaggedValue::Primitive(Primitive::Int(x)) => Ok(x.to_string()), UntaggedValue::Primitive(Primitive::Filesize(x)) => Ok(x.to_string()), UntaggedValue::Primitive(Primitive::FilePath(x)) => Ok(x.display().to_string()), + UntaggedValue::Primitive(Primitive::BigInt(x)) => Ok(x.to_string()), UntaggedValue::Primitive(Primitive::ColumnPath(path)) => Ok(path .iter() .map(|member| match &member.unspanned {