From 66b84f37e18e4ba5f9b3463f84f4bbbefb6c4341 Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> Date: Sat, 15 Jan 2022 11:34:44 +0000 Subject: [PATCH] Fix record formatting in 1.58 (#1178) --- parquet/src/record/api.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parquet/src/record/api.rs b/parquet/src/record/api.rs index 0293ffee7da0..f5b30753dfee 100644 --- a/parquet/src/record/api.rs +++ b/parquet/src/record/api.rs @@ -716,15 +716,19 @@ impl fmt::Display for Field { Field::Float(value) => { if !(1e-15..=1e19).contains(&value) { write!(f, "{:E}", value) + } else if value.trunc() == value { + write!(f, "{}.0", value) } else { - write!(f, "{:?}", value) + write!(f, "{}", value) } } Field::Double(value) => { if !(1e-15..=1e19).contains(&value) { write!(f, "{:E}", value) + } else if value.trunc() == value { + write!(f, "{}.0", value) } else { - write!(f, "{:?}", value) + write!(f, "{}", value) } } Field::Decimal(ref value) => {