Expand description
This crate allows the formatting of integer types as superscripts or subscripts. It consists of two traits, FormatSuperscript & FormatSubscript with which the integers can be formatted.
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₈₄₀");Traits§
- Format
Subscript - Responsible for converting to subscripts₁₂₃.
- Format
Superscript - Responsible for converting to superscripts¹²³.