-1
<?= round(number_format($vehicle->prices['total_rental'], 2, '.', ',') * 0.50,2) ?>
我想輸出到下兩個小數位(錢/美元&美分)。
當$vehicle->prices
爲below $1,000
時,此功能非常有用。當$vehicle->prices
是above $1,000
時,它只輸出.50
。下一個hundredth (i.e $1,452.62)
的正確方法是什麼?
我一直在嘗試和number_format
。當逗號出現時,我似乎無法讓任何一個人產生正確的輸出。
非常感謝您的幫助。 – corus