【发布时间】:2016-11-23 16:10:31
【问题描述】:
问题:
我想呈现带有格式值的表单文本。
案例
[input:text] // 这是文本输入
[5000] // 这是我没有
number_format()的文本输入[5.000] // 这是我的目标
代码:
$protQty = new Text('protQty',[
'placeholder' => 'Jumlah Pesan ( Hanya Angka ) ',
'class' => 'form-control ',
'value' => number_format($entity->protQty,0,",","."), //unworking code
'readonly' => true
]);
$protQty->setLabel('Jumlah Permintaan');
$this->add($protQty);
【问题讨论】:
-
你现在得到什么输出?您的
number_format应该会产生所需的输出。 -
@Timothy,你好! :D 简而言之,我想要输出 5.000,正如我上面解释的那样,但那是我的代码不适用于
number_format()-ing$entity->protQty。 -
$entity->protQty背后隐藏着什么价值,你能var_dump看看吗?
标签: forms number-formatting phalcon volt