thai-baht-text v2.0.5
Thai Baht Text JS
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.
> 10050
// หนึ่งหมื่นห้าสิบบาทถ้วน
Installation | วิธีติดตั้ง
npm install thai-baht-text --save
or
yarn add thai-baht-text
Usage | วิธีการใช้งาน
Javascript ES5
const ThaiBahtText = require('thai-baht-text') // for ES5
let money = 10050
let moneyText = ThaiBahtText(money)
console.log(moneyText)
// OUTPUT: หนึ่งหมื่นห้าสิบบาทถ้วน
money = 12345678988888.50
console.log(ThaiBahtText(money))
// OUTPUT: สิบสองล้านล้านสามแสนสี่หมื่นห้าพันหกร้อยเจ็ดสิบแปดล้านเก้าแสนแปดหมื่นแปดพันแปดร้อยแปดสิบแปดบาทห้าสิบสตางค์
More infomation ES5 Example
Javascript ES6
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 projectnpm 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.
Library & Development Tools
License
The Thai-Baht-Text JS is open-sourced software licensed under the MIT license.
Ending message
If you found bugs or some missing point, please send pull request back or open an issue.
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
แปลงเลขให้เป็นหน่วยบาทไทย
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
5 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago