n

name-it

@preview

Get the English names of integers.

v0.1.2
GPL-3.0-only

Package Information

Last Updated
Authors
RubixDev

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/name-it:0.1.2

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/name-it:0.1.2": *

Version History

0.1.2
8b7172cb6cfa...
0.1.1
2fd2c59b0972...
0.1.0
8af7083ae3e2...

name-it

Get the English names of integers.

Example

Example

#import "@preview/name-it:0.1.0": name-it

#set page(width: auto, height: auto, margin: 1cm)

- #name-it(-5)
- #name-it(-5, negative-prefix: "minus")
- #name-it(0)
- #name-it(1)
- #name-it(10)
- #name-it(11)
- #name-it(42)
- #name-it(100)
- #name-it(110)
- #name-it(1104)
- #name-it(11040)
- #name-it(11000)
- #name-it(110000)
- #name-it(1100004)
- #name-it(10000000000006)
- #name-it(10000000000006, show-and: false)
- #name-it("200000000000000000000000007")

Usage

name-it

Convert the given number into its English word representation.

#let name-it(num, show-and: true, negative-prefix: "negative") = { .. }

Arguments:

  • num: int,str — The number to name.
  • show-and: bool — Whether an “and” should be used in certain
    places. For example, “one hundred ten” vs “one hundred and ten”.
  • negative-prefix: str — The prefix to use for negative numbers.