Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP show money_format without currency text

In PHP, is it possible to use money_format to display money without showing the currency or at least showing it in an abbreviated form?

Currently, I use:

$money = "1234.56";
setlocale("LC_ALL", "de_DE");
$money = money_format("%n", $money);
like image 417
Frank Vilea Avatar asked Jul 05 '11 18:07

Frank Vilea


2 Answers

!

Seriously. that's the flag:

$money = money_format("%!n", $money);
like image 148
cwallenpoole Avatar answered Nov 15 '22 13:11

cwallenpoole


try number_format($money)

http://php.net/manual/en/function.number-format.php

like image 20
rackemup420 Avatar answered Nov 15 '22 12:11

rackemup420