- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
为什么会出现这个错误?
代码:
setlocale(LC_MONETARY, "en_US");
$pricetotal = money_format("%10.2n", $pricetotal);
服务器详细信息。
Apache Version : 2.2.21
PHP Version : 5.3.8
我收到以下错误
Fatal error: Call to undefined function money_format()
最佳答案
来自manual :
The function
money_format()
is only defined if the system hasstrfmon
capabilities. For example, Windows does not, somoney_format()
is undefined in Windows.
money_format()
基本上是 C 库函数 strfmon()
的包装器,如手册所述。
如果你查看评论,有 an implementation by Rafael M. Salvioni .值得一试。您可以使用 function_exists() 检查它是否已经定义.
this StackOverflow question 的答案给出更多(可能更好)的替代方案(thx danielson317)。
关于php - 在 money_format 函数中出现 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10715658/
我得到了以下代码 # On va convertir en somme monétaire # We convert our integer into a way to read money
我想使用以下货币中的 php Money_format 函数。 (INR,USD,EUR,GBP,AUD,CNY,HKD,JPY) 在我的系统中,我允许从上面的列表中选择货币,根据选择,我显示金额。
这个问题在这里已经有了答案: 关闭10 年前。 Possible Duplicate: PHP money_format 为什么会这样: setlocale(LC_MONETARY, 'en_US'
我得到了以下代码 # On va convertir en somme monétaire # We convert our integer into a way to read money
我在 TurnkeyLinux 上使用 Laravel 4 并尝试获取 money_format以本地化方式显示货币。 money_format('%.2n', 1222002.09) 返回 1222
我正在尝试使用 money_format 函数。
我们可以使用以下代码获取 $ 标记并格式化货币。 setlocale(LC_MONETARY, 'en_US.UTF-8'); $amount = money_format('%(#1n', $amo
我正在查看 php 中的 money_format 函数,但对如何让它按照我想要的方式进行格式化感到困惑。我不想在我的字符串前面使用 USD,我希望每 3 位数字和 2 个小数点有一个逗号,因此 12
我正在尝试在 PHP 中使用 money_format() 函数,但它给出了以下错误: Fatal error: Call to undefined function money_format() 对
money_format 函数中是否有标志允许您将长货币(例如 USD、EUR)替换为缩写版本($、€)? 最佳答案 是的:文档为当前语言环境的国家货币格式指定了“n”标志:
我不知道如何获取货币符号? 目前我正在使用 setlocale(LC_MONETARY, 'en_GB'); money_format('%i', 1000); 哪个给我输出 GBP1,000 但是我
我正在使用格式为 %.2n 的 money_format,但得到的结果很奇怪。 我整理了示例代码,以便其他人可以自己测试。 1350, 'rate' => .75,
我用 money_format('%(#15.2n',$money) 输出类似 $ 500.00 有没有办法去掉美元符号和 500 之间的空格? 最佳答案 money_format[ docs ] 甚
我正在尝试回应以下内容 echo "The price is money_format('$%i', $price)" 但这实际上是 echo money_format('$%i', 9.99) 是否
我有这个简单的代码: 通常应该给 -4 562,76 $ 的人。但结果总是这样: (4 562,76 $) localeconv() 的输出: Array ( [decimal_point] =>
为什么会出现这个错误? 代码: setlocale(LC_MONETARY, "en_US"); $pricetotal = money_format("%10.2n", $pricetotal);
这个问题在这里已经有了答案: Alternative to money_format() function (15 个回答) 关闭 4 个月前。 每次我尝试运行此代码时,都会显示一条消息: Fatal
这个问题在这里已经有了答案: Alternative to money_format() function (15 个回答) 关闭 4 个月前。 每次我尝试运行此代码时,都会显示一条消息: Fatal
我一直在思考如何在 PHP 中处理货币显示和数学运算,并且很长一段时间以来一直使用 DECIMAL 类型将其存储在 MySQL 中,并使用 money_format( ) 对其进行格式化以显示在网页上
我是一名优秀的程序员,十分优秀!