Reputation: 1298
I'm at the moment using the PHP money_format()
function, and have money_format('%.0i', $row['price'])
at the moment it outputs something like: DKK 199.900
- is there a way I can output it like 199.900 DKK
instead?
Upvotes: 2
Views: 1564
Reputation: 3449
Actually @sandeep was right, he just forgot to add the !
to remove the monetary symbol from the beginning.
setlocale(LC_MONETARY, 'da_DK');
$money_in_the_bank = 9333;
echo money_format('%!.0i DKK', $money_in_the_bank);
This will output:
9.333 DKK
Upvotes: 0
Reputation: 11
So the pattern money_format('%!.0i DKK', $price);
could be a solution where !
will put off auto currency sign and it is added manually at the end
Upvotes: 0
Reputation: 3500
Use number_format
instead (this is cross OS compatible too):
$value = number_format($value, [decimal places]).' DKK';
Upvotes: 3