[SOLVED] money_format on windows?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

[SOLVED] money_format on windows?

Post by malcolmboston »

im aware that the function money_format() is a linux only function, is there a similar function designed for windows users or do i have to do the maths myself?

i have both linux and windows web server but 99% of the time work in windows as thats where all my good software resides so i really need an equivalent so i dont have to keep switching to linux every 5 minutes

Mal
Last edited by malcolmboston on Tue Apr 06, 2004 4:12 am, edited 2 times in total.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

no-one?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

just thought id post the fix

Code: Select all

$money = 12.1342
$currency= sprintf("%01.2f", $money);
// will output 12.13
Post Reply