UPDATE: Adds a bunch of documentation and examples

This commit is contained in:
Nicolás Hatcher
2024-02-19 23:00:55 +01:00
parent c84621e13f
commit 2d6e45ad94
13 changed files with 381 additions and 76 deletions

View File

@@ -0,0 +1,19 @@
use ironcalc_base::{cell::CellValue, model::Model};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut model = Model::new_empty("hello-world", "en", "UTC")?;
// A1
model.set_user_input(0, 1, 1, "Hello".to_string());
// B1
model.set_user_input(0, 1, 2, "world!".to_string());
// C1
model.set_user_input(0, 1, 3, "=CONCAT(A1, \" \", B1".to_string());
// evaluates
model.evaluate();
assert_eq!(
model.get_cell_value_by_index(0, 1, 3),
Ok(CellValue::String("Hello world!".to_string()))
);
Ok(())
}