Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2006, 05:46 AM
Authorized User
 
Join Date: Jan 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Currency Format

Hi,

   I have waste alot ot time to search this but in vain.
I want to show the amout in the cuuency format style.
like 60000 to 60,000.

If any one knows about this, plz tell me.
Thanks.

 
Old April 18th, 2006, 03:52 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here it is

setlocale(LC_MONETARY, 'en_US'); // Define the country
$Money = 60000;
$formatted = number_format($Money , 2);

result : 60.000


from: Jahan Akhtar
 
Old June 5th, 2006, 02:24 AM
Registered User
 
Join Date: Jun 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to phpguru0000 Send a message via Yahoo to phpguru0000
Default

$val = 60000;

/*
Single parameter with the number_format function formats without decimals, but with a comma (",") between every group of thousands
*/

$formatVal = number_format($val);







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a value in datagrid to currency format? jhansib4u ADO.NET 0 December 12th, 2007 01:43 AM
Currency Format kdkcchoco ASP.NET 1.0 and 1.1 Professional 1 March 29th, 2007 08:13 AM
datagridview currency format rounds off cents TomH VB Databases Basics 2 September 12th, 2006 11:24 AM
format currency civa Access 3 December 16th, 2005 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.