当前位置:网站首页>Turn trendsoft/capital amount of Chinese capital library
Turn trendsoft/capital amount of Chinese capital library
2022-08-02 03:55:00 【phpreturn】
Installation
$ composer require "trendsoft/capital" -vvv
Example of usage
If the fractional part is more than 2 digits, it will be rounded up.
( new Money( 0.001 ) )->toCapital(); //zero dollar( new Money( 0.005 ) )->toCapital(); //One point( new Money( 0.01 ) )->toCapital(); //One point( new Money( 0.10 ) )->toCapital(); //One corner( new Money( 0.105 ) )->toCapital(); //One dime( new Money( 0.11 ) )->toCapital(); //One dime( new Money( 0.15 ) )->toCapital(); //one quarter cent( new Money( 1.01 ) )->toCapital(); //One yuan and one cent( new Money( 10.01 ) )->toCapital(); //One hundred and one cents( new Money( 0.09 ) )->toCapital(); // nine points( new Money( 1.0 ) )->toCapital(); //One dollar( new Money( 1.1 ) )->toCapital(); //One dollar and one corner( new Money( 2.0 ) )->toCapital(); //two yuan( new Money( 2.1 ) )->toCapital(); //two yuan and one corner
Algorithms
Integer part
Example: 10001000
One thousand one thousand one thousand one thousand one thousand yuan
Convert billion
, million
, leading zeros to trailing
10000000,000,000,000
Remove the units of zero pick
, zero hundred
, zero thousand
one thousand million yuan
Process zero zero
as zero
. 2
times (picks
, hun
, thousand
) twice just changed zero zero zero
to zero
One million, one thousand and one thousand yuan
One thousand million one thousand yuan
Processing zero
zero billion
, zero thousand
, zero yuan
10,010,000 yuan
Decimal part
Example: 0.75
Zero score
processing as empty
Zero angle
processing
If there is an integer part, turn zero angle
to zero
If there is no integer part, turn zero angle
to be empty
Special Handling
For example: 0
, 0.00
Return zero element
边栏推荐
- 三月底啦啦
- SQL classification, DQL (Data Query Language), and corresponding SQL query statement demonstration
- 微信小程序自定义swiper轮播图面板指示点|小圆点|进度条
- Phpstudy安装Thinkphp6(问题+解决)
- [league/flysystem] An elegant and highly supported file operation interface
- JS对象, 函数和作用域
- Solve the problem of uni - app packaged H5 website to download image
- PHP基金会三月新闻公告发布
- 5.19今日学习
- js eventLoop 事件循环机制
猜你喜欢
随机推荐
DVWA drone installation tutorial
解决5+APP真机测试无法访问后台(同局域网)
IO streams, byte stream and byte stream buffer
QR code generation API interface, which can be directly connected as an A tag
[league/climate]一个功能健全的命令行功能操作库
Baidu positioning js API
5.19今日学习
TCP communications program
1.11今日学习
面试总结 22/7/25 面试中的重点
Phpstudy安装Thinkphp6(问题+解决)
宝塔邮局邮箱设置成功后能发送不能接收问题处理
After the mailbox of the Pagoda Post Office is successfully set up, it can be sent but not received.
Advanced Operations on Arrays
如何计算地球上两点的距离(附公式推导)
阿里云MySQL5.7安装以及部分主要问题(总和)
微信小程序云开发之模糊搜索
About the apache .htaccess file of tp
v-on基本使用、参数传递、修饰词
1.uview form校验位置可以改变 2.时间区间