将数字转换为字母

发布于 2024-09-11 23:59:51 字数 172 浏览 0 评论 0原文

我正在编写发票脚本。我正在寻找一个将数字转换为字母的 php 脚本。例如,发票显示此值:155€

脚​​本自动输入:一百五十五 有

什么想法吗?

注意:我找到了一些脚本,但我想要一个支持法语字母的脚本。

谢谢 :)

I'm programming an invoice script. I'm looking for a php script that convert number to letter. Exemple, the invoice show this value : 155€

The script put automatically: ONE HUNDRED FIFTY FIVE

Any ideas ?

N.B: I find some script but i want one that support FRENCH letters.

Thank you :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南城追梦 2024-09-18 23:59:51

请参阅:

要使用 Numbers_Words 转换为法语,您需要:

// include class
include("Numbers/Words.php");

// create object
$nw = new Numbers_Words();

// convert to string
echo "3000000 in words is " . $nw->toWords(3000000, 'fr');
                                                     ^
                                             Language Specified

See:

To convert to French with Numbers_Words, you do:

// include class
include("Numbers/Words.php");

// create object
$nw = new Numbers_Words();

// convert to string
echo "3000000 in words is " . $nw->toWords(3000000, 'fr');
                                                     ^
                                             Language Specified
老街孤人 2024-09-18 23:59:51

如果您找不到法语脚本,请使用英语脚本并将其转换为您想要的内容 - 它会足够接近您需要的内容,并且只需将数字单词更改为法语即可。

If you can't find a French script, take an English one and convert this to do what you're after - it'll be close enough to what you need, and should need little more than changing the number words to French.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文