diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-10 19:25:25 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-10 19:25:25 +0200 |
| commit | 5ff507db2f6667a0305e2382037710f6082d75da (patch) | |
| tree | 94954bc8547e62ac8cbdbfd327d21712deb9fef2 /src/sheet/cell.rs | |
| parent | 63cfcbe7a7745b276de58ec92e0141b958c44feb (diff) | |
imlement native csv loader
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()), + } } } |