tafia / calamine

A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets
MIT License
1.61k stars 155 forks source link

Add functions converting DataType to int/float/str #320

Closed Geo-W closed 1 year ago

Geo-W commented 1 year ago

This pr tries to address two issues.

  1. Users might mistakenly store number as text in a workbook, this gives the flexibility to read the data.
  2. xlsx reader always return float when dealing with number, but in reality not all the numbers contain decimal spaces. https://github.com/tafia/calamine/blob/51116dcba4becb126e29e03b4cf8afcbffb7324d/src/xlsx.rs#L968-L983
Geo-W commented 1 year ago

update function name and recover lines formatted by IDE formatter lol

tafia commented 1 year ago

There seem to be some fmt issue. Can you double check? Thanks