Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何将int/值转换为curreny/price?_Php_Sql_Drupal - Fatal编程技术网

Php 如何将int/值转换为curreny/price?

Php 如何将int/值转换为curreny/price?,php,sql,drupal,Php,Sql,Drupal,我在用drupal 我有一个字段,用户在其中指定价格 我在我的第三方物流中打印了价格字段 <?php print $node->my_form['amt'] ?> 但是价格是0.050,我如何让它显示为0.50英镑?请参见。请参见或参见printf变体: <?php printf('£%01.2f', $node->my_form['amt']) ?> Output: £0.05 产出:0.05英镑 您可能需要检查此处的详细信息,并确保已配置/选

我在用drupal

我有一个字段,用户在其中指定价格

我在我的第三方物流中打印了价格字段

<?php print $node->my_form['amt'] ?>

但是价格是0.050,我如何让它显示为0.50英镑?

请参见。

请参见或参见
printf
变体:

<?php printf('£%01.2f', $node->my_form['amt']) ?>

Output: £0.05

产出:0.05英镑

您可能需要检查此处的详细信息,并确保已配置/选择货币格式化程序


根据您的定价方式,您可能希望在解决方案中看到此问题。

我想您的意思是0.050->.0英镑,对吗?请告诉您的浏览器以UTF-8编码显示网站,请参阅或使用
£HTML实体。