• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1306
  • Last Modified:

money_format for Windows

Hey Guys,

I have a Windows 2008 Server at home that I installed Apache, PHP & MySql on. I got everything working. I moved over some PHP files I have working on my Hostmonster account. All the code works fine on the hostmonster site, but when I move it to the Windows based system I find that my money_format() function does not work. I did some research and found out that its not supported under Windows.. (*&*#$%) I'm looking to make the following code work under Windows, can someone help me with the windows equivalent:

 setlocale(LC_MONETARY, 'en_US'); //Set Currency to US. This will put a $ in front of the   number
$msrp = money_format('%.0n' ,$rows['MSRP']); //This sets the format for the dollar amount to $##,### no cents

  • 3
1 Solution
Ray PaseurCommented:
You can probably use number_format() and concatenate the string literal '$' (note single quotes) to the front of the value.
Ray PaseurCommented:
See http://www.laprbass.com/RAY_temp_rraymond1130.php

<?php // RAY_temp_rraymond1130.php

$var = 1234;
setlocale(LC_MONETARY, 'en_US'); //Set Currency to US. This will put a $ in front of the   number
$msrp = money_format('%.0n' ,$var);

$msrp = '$' . number_format($var,0);

Open in new window

Best of luck with your project, ~Ray
rraymond1130Author Commented:
You are the man Ray.... Thanks for all your help....
Ray PaseurCommented:
Thanks for the points - it's a great question, ~Ray
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now