迅睿開源框架是一款PHP8高性能·簡(jiǎn)單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
訂單模塊調(diào)用出來的價(jià)格怎么去掉后面的0,比如1元就顯示1元不要顯示1.00元
求高手指點(diǎn)!
{str_replace(".00", "", 變量)}
模版里 別用number_format 函數(shù)即可
<strong>{if $t.order_score}{intval($t.price)}{SITE_SCORE}{else}¥{number_format($t.price, 2)}元{/if}</strong>
或者直接改成
<strong>{if $t.order_score}{intval($t.price)}{SITE_SCORE}{else}¥{number_format($t.price)}元{/if}</strong>
那就不會(huì)有后兩位小小數(shù)了
{str_replace(".00", "", 變量)}
模版里 別用number_format 函數(shù)即可
<strong>{if $t.order_score}{intval($t.price)}{SITE_SCORE}{else}¥{number_format($t.price, 2)}元{/if}</strong>或者直接改成
<strong>{if $t.order_score}{intval($t.price)}{SITE_SCORE}{else}¥{number_format($t.price)}元{/if}</strong>那就不會(huì)有后兩位小小數(shù)了