Skip to content

Commit

Permalink
fix: always parse a string cell as string
Browse files Browse the repository at this point in the history
  • Loading branch information
PrettyWood committed Oct 20, 2024
1 parent 5290277 commit 00e6f96
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/xlsx/cells_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
// * <c .. t='v' .. > indicates calculated value (this case)
// * <c .. t='f' .. > 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
Expand Down

0 comments on commit 00e6f96

Please sign in to comment.