https://github.com/rubixdev/typst-name-it
Get the English names of integers in Typst.
https://github.com/rubixdev/typst-name-it
Last synced: 3 months ago
JSON representation
Get the English names of integers in Typst.
- Host: GitHub
- URL: https://github.com/rubixdev/typst-name-it
- Owner: RubixDev
- License: gpl-3.0
- Created: 2023-10-04T04:32:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-10T16:48:13.000Z (over 1 year ago)
- Last Synced: 2025-07-31T17:51:42.085Z (9 months ago)
- Language: Typst
- Size: 159 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# name-it
Get the English names of integers.
## Example

```typ
#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.
```typ
#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.
[`str`]: https://typst.app/docs/reference/foundations/str/
[`int`]: https://typst.app/docs/reference/foundations/int/
[`bool`]: https://typst.app/docs/reference/foundations/bool/