/    Sign up×
Community /Pin to ProfileBookmark

currency symbols on windows

How can I get currency symbols to appear on a windows platform using php?

Right now, the following code results in “USD 1250.00”

[FONT=Courier New]$number = 1250

setlocale(LC_MONETARY, ‘en_US’); echo money_format(‘%i’,$number);[/FONT]

I’d like the result to read “$1250.00” (yes, I’m a newb). Any help would be great.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@philo351authorJan 05.2007 — nevemind. I got it. For anyone wondering the same thing, I found the solution by using the number_format solution. The new code looks like this


[FONT=Courier New] echo '$', number_format($number, 2, '.', ',')[/FONT]
×

Success!

Help @philo351 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...