GitHub - sandervanhooft/laravel-blade-readable-numbers: Laravel Blade directive...
source link: https://github.com/sandervanhooft/laravel-blade-readable-numbers
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
Blade directive for short human readable numbers (i.e. 3K+, 4M+)
Adds the @readable_int
directive to Laravel's Blade templating system. This way you can shorten numbers into strings like 123K+
.
Installation
You can install the package via composer:
composer require sandervanhooft/laravel-blade-readable-numbers
Usage
@readable_int(123456) // outputs 123K+ @readable_int(123456789) // outputs 123M+ @readable_int(123456789012) // outputs 123B+ @readable_int(123456789012345) // outputs 123T+
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Sander van Hooft - www.sandervanhooft.com
- Appstract for blade directive testing methods
- Radley Sustaire (RadGH) and Hassan Amir Khan (hassanamirkhan) for the short-number-format gist.
- All Contributors
Never miss a new package release
Subscribe to the newsletter at sandervanhooft.com to learn about the latest Laravel packages and tricks.
License
The MIT License (MIT). Please see License File for more information.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK