| Crates.io | indexing_fmt |
| lib.rs | indexing_fmt |
| version | 0.1.1 |
| created_at | 2025-06-18 10:12:14.306074+00 |
| updated_at | 2025-06-18 10:40:57.381188+00 |
| description | Format superscripts and subscripts easily. (no_std) |
| homepage | |
| repository | https://github.com/jonaspleyer/indexing_fmt |
| max_upload_size | |
| id | 1716824 |
| size | 21,311 |
This crate allows the formatting of integer types as superscripts or subscripts.
It is written in pure safe Rust and no_std compatible.
use indexing_fmt::*;
let index = 12;
let name = format!("Ship{}", index.to_superscript());
assert_eq!(name, "Ship¹²");
let index = 840;
let name = format!("Docking-Bay{}", index.to_subscript());
assert_eq!(name, "Docking-Bay₈₄₀");