Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vh13294/number-to-khmer-word

Library for converting standard numerals to Khmer words
https://github.com/vh13294/number-to-khmer-word

Last synced: 20 days ago
JSON representation

Library for converting standard numerals to Khmer words

Awesome Lists containing this project

README

        

Number to Khmer words



Try it!



CodeFactor


NPM Version


NPM Downloads


License

# Description

Javascript and Typescript library for converting Arabic numerals to Khmer words

# Installation

```bash
npm i number_to_khmer_word
```

# Basic Usage

### Include Module

```ts
import { numberToWord } from 'number_to_khmer_word';

const words = numberToWord(input: number | string)

// Example
numberToWord(100_000)
numberToWord('1000')
```

For Currency Mode

CurrencyType = ['USD', 'KHR']

```ts
import { currencyToWord } from 'number_to_khmer_word';

const words = currencyToWord(input: number | string, currency: currencyType)

// Example
currencyToWord(100_000, 'USD')
currencyToWord('1000', 'KHR')
```

### TODO

- [ ] Allow copy paste but show error toast if invalid number (insert in series)
- [ ] Animate text change