From 00e6f9656635209b5fc2f35316dabf2849796f83 Mon Sep 17 00:00:00 2001 From: Eric Jolibois Date: Sun, 20 Oct 2024 16:50:43 +0200 Subject: [PATCH] fix: always parse a string cell as string --- src/xlsx/cells_reader.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/xlsx/cells_reader.rs b/src/xlsx/cells_reader.rs index 53d80a0..4c907ff 100644 --- a/src/xlsx/cells_reader.rs +++ b/src/xlsx/cells_reader.rs @@ -359,17 +359,8 @@ fn read_v<'s>( Ok(DataRef::DateTimeIso(v)) } Some(b"str") => { - // see http://officeopenxml.com/SScontentOverview.php - // str - refers to formula cells - // * indicates calculated value (this case) - // * to the formula string (ignored case - // TODO: Fully support a Data::Formula representing both Formula string & - // last calculated value? - // - // NB: the result of a formula may not be a numeric value (=A3&" "&A4). - // We do try an initial parse as Float for utility, but fall back to a string - // representation if that fails - v.parse().map(DataRef::Float).or(Ok(DataRef::String(v))) + // string + Ok(DataRef::String(v)) } Some(b"n") => { // n - number