indexing_fmt 0.1.1

Format superscripts and subscripts easily. (no_std)
Documentation
  • Coverage
  • 60%
    3 out of 5 items documented1 out of 5 items with examples
  • Size
  • Source code size: 20.84 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 844.72 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • jonaspleyer/indexing_fmt
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • jonaspleyer

indexing_fmt

Crates.io Version GitHub Actions Workflow Status License MIT License Apache Docs

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