From 76f6d0c111351872fcc2f840b3154121190406b9 Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies Date: Fri, 14 Jan 2022 22:24:09 +0000 Subject: [PATCH] Fix record formatting in 1.58 --- 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) => {