Crates.io | spreadsheet_addresses |
lib.rs | spreadsheet_addresses |
version | 1.0.3 |
source | src |
created_at | 2024-04-22 20:58:23.403815 |
updated_at | 2024-04-22 21:34:13.98366 |
description | Convert spreadsheet addresses ("A4", "B$7" and so on) to a struct and vice versa! |
homepage | |
repository | https://github.com/MAA28/spreadsheet_addresses |
max_upload_size | |
id | 1216770 |
size | 11,916 |
Convert spreadsheet addresses to coordinates and vice versa in a fully tested and documented way!
Are you working on a spreadsheet application or something of the sort? What, you are not sure how to implement these address names? No worries - i have got you covered!
use spreadsheet_addresses::{Coordinate, AddressParsingError};
let coordinate1 = Coordinate::from_address("$CV23");
let coordinate2 = Coordinate::from_address("Hello World");
assert_eq!(
coordinate1,
Ok(Coordinate {
row: 22,
column: 99,
relative_row: true,
relative_column: false,
})
);
assert_eq!(
coordinate2,
Err(AddressParsingError {
input: "Hello World".to_string()
})
);
use spreadsheet_addresses::Coordinate;
let coordinate = Coordinate::new(22, 99, true, false);
let address = coordinate.to_address();
assert_eq!(
address,
"$CV23".to_string()
);