【发布时间】:2017-06-01 22:38:10
【问题描述】:
我使用刀片模板并编写:
<div class="col-md-2 col-xs-4 text-right" style="padding:0px;">
<h2 class="text-theme" style="font-size:36px !important; margin-top:0px !important;">£{{round($product->price,0)}} <sup style="position: relative;vertical-align: baseline;line-height: 0;font-size: 14px;top: -1.2em;">
{{number_format($product->price - floor($product->price)),2}}
</sup>
</h2>
</div>
现在我得到了 tc。 96 0
我如何获得<sup> 小数部分,如果它的 0 是 00,如果它的 5 是 50?
【问题讨论】:
-
我也试试:sscanf(number_format($product->price, 2, ".", ","), '%d.%d', $whole, $fraction);但不工作
标签: php html blade number-formatting