summaryrefslogtreecommitdiff
path: root/src/sheet/cell.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-10 19:25:25 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-10 19:25:25 +0200
commit5ff507db2f6667a0305e2382037710f6082d75da (patch)
tree94954bc8547e62ac8cbdbfd327d21712deb9fef2 /src/sheet/cell.rs
parent63cfcbe7a7745b276de58ec92e0141b958c44feb (diff)
imlement native csv loader
Diffstat (limited to 'src/sheet/cell.rs')
-rw-r--r--src/sheet/cell.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sheet/cell.rs b/src/sheet/cell.rs
index d723732..6973b96 100644
--- a/src/sheet/cell.rs
+++ b/src/sheet/cell.rs
@@ -57,7 +57,10 @@ impl From<String> for Cell {
impl From<&str> for Cell {
fn from(value: &str) -> Self {
- Cell::String(value.to_string())
+ match value.parse::<f64>() {
+ Ok(n) => Cell::Number(n),
+ Err(_) => Cell::String(value.to_string()),
+ }
}
}