tafia / calamine

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

fix datetime precision, fix panic on date overflow #309

Closed dimastbk closed 1 year ago

dimastbk commented 1 year ago

Hi! This PR add two fixes for parsing excel datetime:

  1. Additional fix for #251 and #277 - replace type coersion with f64.round(): 0.25951736111111101 * 24f64 * 60f64 * 60f64 * 1e+3f64 = 22422299,99999999 before: 22422299,99999999 as i64 = 22422299 = 06:13:42.299 after: 22422299,99999999.round() as i64 = 22422300 = 06:13:42.300
  2. Fix panic on datetime overflow.
tafia commented 1 year ago

Thanks!