首页 > 解决方案 > 如何在 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",

如何解决这个问题?

标签: apilaravel-6numberformatter

解决方案


sudo apt-get install php-intl
service apache2 restart

推荐阅读