a

a2c-nums

@preview

Convert a number to Chinese

v0.0.1
MIT
1 downloads

Package Information

Last Updated
Minimum Typst Version
0.10.0

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/a2c-nums:0.0.1

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/a2c-nums:0.0.1": *

Version History

0.0.10.10.0
9eb058afb819...

a2c-nums

Convert Arabic numbers to Chinese characters.

usage

#import "@preview/a2c-nums:0.0.1": int-to-cn-num, int-to-cn-ancient-num, int-to-cn-simple-num, num-to-cn-currency

#int-to-cn-num(1234567890)

#int-to-cn-ancient-num(1234567890)

#int-to-cn-simple-num(2024)

#num-to-cn-currency(1234567890.12)

Functions

int-to-cn-num

Convert an integer to Chinese number. ex: #int-to-cn-num(123) will be 一百二十三

int-to-cn-ancient-num

Convert an integer to ancient Chinese number. ex: #int-to-cn-ancient-num(123) will be 壹佰贰拾叁

int-to-cn-simple-num

Convert an integer to simpple Chinese number. ex: #int-to-cn-simple-num(2024) will be 二〇二四

num-to-cn-currency

Convert a number to Chinese currency. ex: #int-to-cn-simple-num(1234.56) will be 壹仟贰佰叁拾肆元伍角陆分

more details

Reference demo.typ for more details please.