Convert number to Thai Bath as Text
npm install thai-baht-text



!ts
>### Now, Thai Baht text supports TypeScript 🎉!!
Thai Baht Text JS converts numbers into Thai text. It provides flexibility as a cross-platform library for both browser and Node.js, written in TypeScript.
In the browser, you can simply add thai-baht-text.min.js in a script tag without needing to install any additional libraries or polyfills.
``Javascript`
> 10050
// หนึ่งหมื่นห้าสิบบาทถ้วน
bash
npm install thai-baht-text --save
`
or
`bash
yarn add thai-baht-text
`
Usage | วิธีการใช้งาน
#### Javascript ES5
`javascript
const ThaiBahtText = require('thai-baht-text') // for ES5let money = 10050
let moneyText = ThaiBahtText(money)
console.log(moneyText)
// OUTPUT: หนึ่งหมื่นห้าสิบบาทถ้วน
money = 12345678988888.50
console.log(ThaiBahtText(money))
// OUTPUT: สิบสองล้านล้านสามแสนสี่หมื่นห้าพันหกร้อยเจ็ดสิบแปดล้านเก้าแสนแปดหมื่นแปดพันแปดร้อยแปดสิบแปดบาทห้าสิบสตางค์
`
More infomation ES5 Example
___#### Javascript ES6
`javascript
import ThaiBahtText from 'thai-baht-text'let money = 10050
const moneyText = ThaiBahtText(money)
console.log(moneyText)
// OUTPUT: หนึ่งหมื่นห้าสิบบาทถ้วน
money = 12345678988888.50
console.log(ThaiBahtText(money))
// OUTPUT: สิบสองล้านล้านสามแสนสี่หมื่นห้าพันหกร้อยเจ็ดสิบแปดล้านเก้าแสนแปดหมื่นแปดพันแปดร้อยแปดสิบแปดบาทห้าสิบสตางค์
`More infomation ES6 Example
More infomation Browser version (UMD)
Development
* npm run test to run all tests in this project
* npm run test:watch` to run all tests in watch mode. This allows us to develop/refactor code and get fast feedback to ensure we don't break anything.Thank you so much 😃
Regards,
Jirachai Chansivanon
___
แปลง เลข เป็น บาทไทย,
thai baht text javascript,
thai baht text js
that-baht-text.js
that-baht-text.js typescript
Convert number to Thai Baht as Text
แปลงเลขให้เป็นหน่วยบาทไทย