Indexing_fmt: A helper crate to format super¹²³ and sub₈₄₀ scripts

⚓ rust    📅 2025-06-18    👤 surdeus    👁️ 3      

surdeus

Example

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₈₄₀");

3 posts - 2 participants

Read full topic

🏷️ rust_feed