api - 如何在 laravel 中使用 NumberFormatter - 6
问题描述
如何在 Laravel 函数中使用“NumberFormatter”?
我的代码是(我需要将数字转换为 Word)例如:999 就像“九百九十九”
$digit = new NumberFormatter("en", NumberFormatter::SPELLOUT);
echo $digit->format(1000);
它给出的错误如下:
"message": "Class 'Modules\\Receipts\\Http\\Controllers\\NumberFormatter' not found",
"exception": "Symfony\\Component\\Debug\\Exception\\FatalThrowableError",
如何解决这个问题?
解决方案
sudo apt-get install php-intl
service apache2 restart
推荐阅读
- django - 是否可以在重定向()调用中将模板上下文变量作为参数传递
- amazon-web-services - AWS 自动扩展和 Spot 实例
- python - 如果我将它放在仅在循环中调用的已定义函数中,我如何忽略“继续”的 SyntaxError 在 Python 中未正确循环?
- office-js - OfficeJS Office.context.document.getTaskFieldAsync 在某些重要字段上失败
- django - 将 JWT 访问密钥存储在 Cookie 中,但仍无法访问 API
- java - 打印出 ArrayList 的每个元素而不重复元素并重新打印
- reactjs - 如何使用 react 将数据传递给 Modal。编辑还是删除?
- ruby-on-rails - 将自定义参数传递给 devise.en.yml 以在错误消息中使用
- python - Python的点图,每个不同的颜色?
- java - 为什么我的 JavaCL 只检测到集成显卡?