https://github.com/hckhanh/vn-number
🛠A bunch of utility functions that work with number in 🇻🇳 Vietnamese language
https://github.com/hckhanh/vn-number
language library money package string utilities utility vietnam vietnamese vietnamese-language
Last synced: 2 months ago
JSON representation
🛠A bunch of utility functions that work with number in 🇻🇳 Vietnamese language
- Host: GitHub
- URL: https://github.com/hckhanh/vn-number
- Owner: hckhanh
- License: mit
- Created: 2024-02-26T03:48:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T06:32:23.000Z (2 months ago)
- Last Synced: 2025-02-25T07:38:27.557Z (2 months ago)
- Topics: language, library, money, package, string, utilities, utility, vietnam, vietnamese, vietnamese-language
- Language: TypeScript
- Homepage: https://jsr.io/@hckhanh/vn-number
- Size: 99.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vn-number 🇻🇳
[](https://jsr.io/@hckhanh/vn-number)
🛠A bunch of utility functions that work with number in 🇻🇳 Vietnamese language
## Features
- [Zero dependencies](https://jsr.io/@hckhanh/vn-number/dependencies)
- Built-in support for Edge runtime
- Typesafe with TypeScript
- Fully documented## Functions
### Read Vietnamese number (một triệu hai trăm năm mươi nghìn)
```ts
import { readVnNumber } from '@hckhanh/vn-number'const result = readVnNumber(1250000)
console.log(result) // một triệu hai trăm năm mươi nghìn
```### Format number in Vietnamese format (1.250.000)
```ts
import { formatVnNumber } from '@hckhanh/vn-number'const result = formatVnNumber(1250000)
console.log(result) // 1.250.000
```### Format VN currency (VND) (1.250.000 â‚«)
```ts
import { formatVnCurrency } from '@hckhanh/vn-number'const result = formatVnCurrency(1250000)
console.log(result) // 1.250.000 â‚«
```### Format percentage in Vietnamese format (99,1%)
```ts
import { formatVnPercent } from '@hckhanh/vn-number'const result = formatVnPercent(0.991)
console.log(result) // 99,1%
```## Release Notes
You can go to [Releases](https://github.com/hckhanh/vn-number/releases) page to see the release notes.