spreadsheet-column
Convert between spreadsheet column numbers and letters — 1 ↔ A, 26 ↔ Z, 27 ↔
AA (the bijective base-26 used by Excel, Google Sheets, …).
A faithful Rust port of the
spreadsheet-column npm package.
- Zero dependencies,
#![no_std] - One-based (default) or zero-based columns
- Differential-tested against the reference
spreadsheet-columnimplementation (60k cases)
Install
[]
= "0.1"
Usage
use ;
assert_eq!;
assert_eq!;
assert_eq!; // Excel's last column
// Zero-based columns:
let sc = zero_based;
assert_eq!;
assert_eq!;
In one-based mode, from_int(0) is an error (the smallest column is 1); negative numbers
and non-letter strings are errors in both modes.
Contributors ✨
This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.
Thanks goes to these wonderful people:
License
Licensed under either of MIT or Apache-2.0 at your option.