diff options
Diffstat (limited to 'src/sheet/cell.rs')
| -rw-r--r-- | src/sheet/cell.rs | 5 |
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()), + } } } |