1 | <span class="badge-npmversion"><a href="https://npmjs.org/package/@to-da-moon/thai-bath-lib" title="View this project on NPM"><img src="https://img.shields.io/npm/v/@to-da-moon/thai-baht-lib.svg" alt="NPM version" /></a></span> --> [![install size](https://packagephobia.com/badge?p=%40to-da-moon%2Fthai-baht-lib)](https://packagephobia.com/result?p=%40to-da-moon%2Fthai-baht-lib)
|
2 |
|
3 |
|
4 | ## Acknowledgements
|
5 |
|
6 | Support both js and ts
|
7 |
|
8 | This library is free software. We just make it easier for us to get the thai baht.
|
9 |
|
10 | Improve version from bath.js
|
11 |
|
12 | ## Improvement
|
13 | 1. Completely change original code to be from bathjs as it has better performance
|
14 | 2. Fix string 01 showing เอ็ด problem
|
15 | 3. Round satang to be 2 decimal place not just always rounddown
|
16 | 4. When satang reach 999 round it to the decimal place
|
17 | 5. Improve speed from bathjs
|
18 |
|
19 | ## Benchmark
|
20 | MacBook Pro (15-inch, 2016)
|
21 | bahtLatest (x100000): 1886ms
|
22 | thaiBahtLib (x100000): 1755ms
|
23 |
|
24 |
|
25 |
|
26 | ## Getting Started
|
27 |
|
28 | Send in the number to get thai baht result in string format
|
29 |
|
30 | ## Installation
|
31 |
|
32 | using yarn
|
33 | ```
|
34 | yarn add @to-da-moon/thai-baht-lib
|
35 | ```
|
36 | using npm
|
37 | ```
|
38 | npm i @to-da-moon/thai-baht-lib
|
39 | ```
|
40 |
|
41 | ## Example Usage
|
42 |
|
43 | ```
|
44 | bahtText(1)
|
45 | // return thai baht text format
|
46 | // e.g. 1 -> หนึ่งบาทถ้วน
|
47 | ```
|
48 |
|
49 | ```
|
50 | bahtText(100)
|
51 | // return thai baht text format
|
52 | // e.g. 100 -> หนึ่งร้อยบาทถ้วน
|
53 | ```
|
54 |
|
55 | ## Plan
|
56 | - [ ] Let me know what to upgrade, just create issue for us, we will do it.
|