Skip to content

zenepay/baht-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Baht Text: spell baht money from number to text

Latest Stable Version Total Downloads License PHP Version Require

This package helps to translate baht amount to text. This should be useful for Invoice, Receipts in Thai baht

Installation

You can install the package via composer:

composer require zenepay/baht-text

Usage

Just simply calls the static function toText()

Support input of valid money format without symbol eg. 1,000,20.50

use Zenepay\BahtText\Baht;

$totalAmount = '2,010,025.25';
echo Baht::toText($totalAmount); // 'สองล้านหนึ่งหมื่นยี่สิบห้าบาทยี่สิบห้าสตางค์'

validate input format with

-10000.23 // true 1,000.23 // true -1,000.23 // true 1,0000,234.00 //false ู฿1,999,123.33 //false

Demo & Show Case

Credits

License

The MIT License (MIT)

Baht Text: ใช้เพื่อแปลงตัวเลขเงินบาท ให้เป็นข้อความอ่าน

เช่น '2,010,025.25' ==> 'สองล้านหนึ่งหมื่นยี่สิบห้าบาทยี่สิบห้าสตางค์'

การติดตั้ง

ติดตั้งผ่าน composer

composer require zenepay/baht-text

การใช้งาน

use Zenepay\BahtText\Baht;

$totalAmount = '2,010,025.25';
echo Baht::toText($totalAmount); // 'สองล้านหนึ่งหมื่นยี่สิบห้าบาทยี่สิบห้าสตางค์'

รองรับค่า input ที่เป็นจำนวนเงินที่ถูกต้อง มีคอมม่าหรือไม่มีก็ได้ ได้ทั้ง ติดลบและบวก

ดูตัวอย่างในบิล

Credits

License

The MIT License (MIT)

About

Baht Text: spell baht money from number to text

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages