summaryrefslogtreecommitdiff
path: root/src/sheet/cell.rs
diff options
context:
space:
mode:
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()),
+ }
}
}