tafia / calamine

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

Accessing raw string value of the cell (without Data enum) #427

Open requizm opened 2 months ago

requizm commented 2 months ago

I'm reading a cell that has a value like 0.485. Because of the IEEE, I see 0.48500004. Which is understandable. I want to access the raw string value of the cell. Example code:

let mut excel: Xlsx<_> = open_workbook("test.xlsx").unwrap();
let sheet = excel.worksheet_range("Sheet1").unwrap();
for row in sheet.rows() {
    let first_cell: Data = row.iter().next().unwrap();
    // first_cell is f64. But I need to access raw string. So I can make my precision, or use rust_decimal
}