|
 |
|
 |
09-06-2006, 04:41 AM
|
#1 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 3
|
Money_Format problem?
PHP Code:
////////////turn it into currency///////////////////// setlocale(LC_MONETARY, 'en_US'); $price = money_format('%(#10n', $price) ; $pricehigh = money_format('%(#10n', $pricehigh) ; ////////////turn it into currency/////////////////////
I know this was originally designed to run on Linux servers.. just need to change the function MONEY_FORMAT to NUMBER_FORMAT, but not quite sure what else should go with it???
Any takers?? 
Last edited by redhead; 09-06-2006 at 07:32 AM.
|
|
|
09-06-2006, 07:33 AM
|
#2 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,487
|
give us an example of $price before it gets put into the function.
then, give us an example of the exact text you want to convert it to.
__________________
Mike
|
|
|
09-06-2006, 07:57 AM
|
#3 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 3
|
Money_format function
Thanks for getting back to me....
to give you a better understanding of what i,am trying to atain... this is based on a property search enginge so i can enter into my control.php the property $price..
This $price would be stored in my MYSQL database.. once entered the price would be displayed to the user on the broswe.php or search.php..
PHP Code:
//////////////Find a single listing record///////////////////////////////////
function findListing()
{
$id = $_GET['id'];
$sql = mysql_query("SELECT * FROM info WHERE pk = '$id'");
while ($row = mysql_fetch_assoc($sql))
{
global $dateentered,$name,$address,$city,$state,$zip,$telephone,$fax,$website,$email,$description,
$bedrooms,$bedroomshigh,$sqfeet,$price,$pricehigh,$pricetype,$category,$location,$proptype,$view,
$units,$delivery,$developer,$fees,$unitsperfloor,$stories,$image1,$image2,$image3,$image4,$image5,
$image6,$image7,$image8,$image9,$image10,$image11,$image12,$featured,$mls,$active,$agent,$features;
$dateentered = $row['dateentered'];
$name = $row['name'];
$address = $row['address'];
$city = $row['city'];
$state = $row['state'];
$zip = $row['zip'];
$telephone = $row['telephone'];
$fax = $row['fax'];
$website = $row['website'];
$email = $row['email'];
$description = stripslashes($row['description']);
$bedrooms = $row['bedrooms'];
$bedroomshigh = $row['bedroomshigh'];
$sqfeet = $row['sqfeet'];
$price = $row['price'];
$pricehigh = $row['pricehigh'];
$pricetype = $row['pricetype'];
$category = $row['category'];
$location = $row['location'];
$proptype = $row['proptype'];
$view = $row['view'];
$units = $row['units'];
$delivery = $row['delivery'];
$developer = $row['developer'];
$fees = $row['fees'];
$unitsperfloor = $row['unitsperfloor'];
$stories = $row['stories'];
$image1 = $row['image1'];
$image2 = $row['image2'];
$image3 = $row['image3'];
$image4 = $row['image4'];
$image5 = $row['image5'];
$image6 = $row['image6'];
$image7 = $row['image7'];
$image8 = $row['image8'];
$image9 = $row['image9'];
$image10 = $row['image10'];
$image11 = $row['image11'];
$image12 = $row['image12'];
$featured = $row['featured'];
$mls = $row['mls'];
$active = $row['active'];
$agent = unserialize($row['agent']);
$features = unserialize($row['features']);
}
////////////turn it into currency/////////////////////
setlocale(LC_MONETARY, 'en_US');
$price = money_format('%(#10n', $price) ;
$pricehigh = money_format('%(#10n', $pricehigh) ;
////////////turn it into currency/////////////////////
}
////////////////////////////////////////////////////////////////////////////////
hope this helps?? many thanks!!
Last edited by redhead; 09-06-2006 at 08:02 AM.
Reason: Use either [code] tags or [php] tags.
|
|
|
09-06-2006, 08:07 AM
|
#4 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
|
I think sde was reffering to some explanation like:
Quote:
|
I have a problem, I want to convert a number like: 23.45 to a user given LOCAL_LANGUAGE specification, given if a user has defined to use LANG_DA, the equivalent value would be 23,45, were it a user having the setting of LANG_US it would be displayed as 23.45
|
The code snipit you've provided dosn't quite satisfy the answered question.
|
|
|
09-06-2006, 08:26 AM
|
#5 (permalink)
|
|
Registered User
Join Date: Sep 2006
Posts: 3
|
My inexperiance shows then... thanks redhead!
The problem is in short,, when i enter the value of $price via my control.php it does not display it to the user... ?????? there is no requirement to change the currency all i want to do is display the price of the property to the user, and for the user to be able to define a search under $price or $pricehigh....
Does that make any sense???
cos i,am drowing and probably a bit outa my depth.... Thanks Alll
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 07:01 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|