RE: [PHP] Formating Numbers

2009-04-25 Thread Warren Vail
nt: Saturday, April 25, 2009 8:38 PM > To: Gary > Cc: php-general@lists.php.net > Subject: Re: [PHP] Formating Numbers > > pl post the desired result, the functions > > if u r trying to get $ 34,567.25 > i dont understand y this is not working for u... > http://php.

Re: [PHP] Formating Numbers

2009-04-25 Thread kranthi
pl post the desired result, the functions if u r trying to get $ 34,567.25 i dont understand y this is not working for u... http://php.net/manual/en/function.number-format.php#88486 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Formating Numbers

2009-04-25 Thread Gary
I cant seem to get this to work for me. I want the number to be formated to money (us, 2 decimal points). I have gone through manual, tried money_format, number_format, along with setting the variable, but I cant seem to get it to work. I'm sure it is something simple I am missing. Thanks for

RE: [PHP] Formating a Double

2006-09-06 Thread Robert Cummings
On Wed, 2006-09-06 at 11:21 -0500, Jay Blanchard wrote: > [snip] > I am trying to format a double to use thousands seperators and such. > number_format does not appear to be working properly for this. > My guess is cause I am trying to format a double rather than a string. > Is there anything out t

RE: [PHP] Formating a Double

2006-09-06 Thread Jay Blanchard
[snip] I am trying to format a double to use thousands seperators and such. number_format does not appear to be working properly for this. My guess is cause I am trying to format a double rather than a string. Is there anything out there that will allow me to format a double to include a comma as a

[PHP] Formating a Double

2006-09-06 Thread Phillip Baker
Greetings All, I am trying to format a double to use thousands seperators and such. number_format does not appear to be working properly for this. My guess is cause I am trying to format a double rather than a string. Is there anything out there that will allow me to format a double to include a

Re: [PHP] Formating

2005-07-07 Thread Bruno B B Magalhães
Hi Richard, On Jul 5, 2005, at 6:20 PM, Richard Lynch wrote: On Mon, July 4, 2005 6:48 pm, Bruno B B Magalhães said: For example I have a brazilian zipcode witch is stored in database as Is she a Good Witch, or a Bad Witch? :-) Ups, hehehehe! 22252970 and must be formatted as N-NNN, w

Re: [PHP] Formating

2005-07-05 Thread Richard Lynch
On Mon, July 4, 2005 6:48 pm, Bruno B B Magalhães said: > For example I have a brazilian zipcode witch is stored in database as Is she a Good Witch, or a Bad Witch? :-) > 22252970 and must be formatted as N-NNN, where N is a number. > Also I have a tax id with is also stored as numeric value

Re: [PHP] Formating

2005-07-05 Thread Jochem Maas
Bruno B B Magalhães wrote: Hi everybody, I've searched the docs for a generic way to format strings and numbers... For example I have a brazilian zipcode witch is stored in database as 22252970 and must be formatted as N-NNN, where N is a number. Also I have a tax id with is also stor

[PHP] Formating

2005-07-05 Thread Bruno B B Magalhães
Hi everybody, I've searched the docs for a generic way to format strings and numbers... For example I have a brazilian zipcode witch is stored in database as 22252970 and must be formatted as N-NNN, where N is a number. Also I have a tax id with is also stored as numeric value only,

Re: [PHP] formating output

2004-12-17 Thread Tatang Widyanto
print "\n"; print "\n"; $counter = 0; while ($result = mysql_fetch_array($pointer)) { $counter++; if ($counter % 4 === 0) { print "".$result[1]."\n"; print "\n"; print "\n"; } else { print "".$result[1]."\n"; } } // add blank cells if number of cell o

RE: [PHP] formating output

2004-12-17 Thread Jay Blanchard
[snip] this structure prints out a table with a new row for each item <$results[1] " ; } ?> what I want to do is print out a table 4 columns wide and however many rows high needed to run through the data HOW do I loop through the array and get data printed 4 times then a new row started and

[PHP] formating output

2004-12-17 Thread Larry L
I'm sure this is easy and I'll feel silly when I see how it's done, but, my mnd is a blank, this structure prints out a table with a new row for each item <$results[1] " ; } ?> what I want to do is print out a table 4 columns wide and however many rows high needed

RE: [PHP] formating date

2003-07-30 Thread Carl Furst
3 11:53 AM To: [EMAIL PROTECTED] Subject: [PHP] formating date My script currently works; printing the date that it extracts from mysql table. It prints the date as: 2004-01-29 $mailed=$row["mailed"]; $payment=$row["payment"]; $ID=$row["ID"]; echo "$m

RE: [PHP] formating date

2003-07-30 Thread Peter Knight
> -Original Message- > > > My script currently works; printing the date that it extracts from mysql > table. > > It prints the date as: > > > > 2004-01-29 > > > > $mailed=$row["mailed"]; > > $payment=$row["payment"]; > > $ID=$row["ID"]; > > echo "$mailed$payment"; > > > > > > I'm trying to

[PHP] formating date

2003-07-30 Thread Gronquist, Jim M
My script currently works; printing the date that it extracts from mysql table. It prints the date as: 2004-01-29 $mailed=$row["mailed"]; $payment=$row["payment"]; $ID=$row["ID"]; echo "$mailed$payment"; I'm trying to change the format so that the date appears as: January 29, 20

Re: [PHP] formating numbers & date

2002-12-04 Thread Jeff Bluemel
worked great... the other method may be a little quicker, but this code is easier for me to understand, and although it is used in a loop there really is no visible difference in how quickly it displays. thanks, Jeff "Justin French" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[E

Re: [PHP] formating numbers & date

2002-12-04 Thread Justin French
on 05/12/02 12:47 PM, Rick Widmer ([EMAIL PROTECTED]) wrote: > Yes, it is simpler to code, but it also takes almost twice as long to run. > > 1000 iterations with strtotime: 0.2296 seconds > 1000 iterations with substr:0.1308 seconds > > Doesn't matter much if you only do it once, but it can

Re: [PHP] formating numbers & date

2002-12-04 Thread Rick Widmer
At 11:51 AM 12/5/02 +1100, Justin French wrote: on 05/12/02 11:37 AM, Rick Widmer ([EMAIL PROTECTED]) wrote: > $Hour = substr( $Date, 11, 2 ); > if( $Hour ) > 12 { > $Hour = $Hour - 12; > $AMPM = 'PM'; > } > > else { > $AMPM = 'AM'; > } > > echo substr( $Date, 5, 2 ), '/', substr( $Date, 8, 2 ),

Re: [PHP] formating numbers & date

2002-12-04 Thread Jeff Bluemel
thanks... I will play with this, and let ya know if I have a problem... looks easy enough. Jeff "Justin French" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > on 05/12/02 11:15 AM, Justin French ([EMAIL PROTECTED]) wrote: > > > Hi, > > > > > $date = '2002-12

Re: [PHP] formating numbers & date

2002-12-04 Thread Justin French
on 05/12/02 11:37 AM, Rick Widmer ([EMAIL PROTECTED]) wrote: > $Hour = substr( $Date, 11, 2 ); > if( $Hour ) > 12 { > $Hour = $Hour - 12; > $AMPM = 'PM'; > } > > else { > $AMPM = 'AM'; > } > > echo substr( $Date, 5, 2 ), '/', substr( $Date, 8, 2 ), '/', > substr( $Date, 0, 4 ), ' ', $Hour, subst

Re: [PHP] formating numbers & date

2002-12-04 Thread Justin French
on 05/12/02 11:15 AM, Justin French ([EMAIL PROTECTED]) wrote: > Hi, > > $date = '2002-12-04 23:21:49'; > $newdate = date('m/d/Y', strtotime($date)); > echo $newdate; > ?> Whooops, forgot the time bit! Should be echo's 12/4/2002 11:21:49 pm also fixed the leading zero's problem :) Justin

Re: [PHP] formating numbers & date

2002-12-04 Thread Rick Widmer
At 04:58 PM 12/4/02 -0700, Jeff Bluemel wrote: I'm displaying a date that I get from a informix database query - the date format is as follows; 2002-12-04 23:21:49 I want it to display as 12/4/2002 11:21:49 PM $Hour = substr( $Date, 11, 2 ); if( $Hour ) > 12 { $Hour = $Hour - 12; $AMPM =

Re: [PHP] formating numbers & date

2002-12-04 Thread Justin French
Hi, Should do the trick -- although I haven't stripped out the leading 0 in either the day or month, hence it will echo 12/04/2002, not 12/4/2002. Season to taste, Justin on 05/12/02 10:58 AM, Jeff Bluemel ([EMAIL PROTECTED]) wrote: > I'm displaying a date that I get from a informix datab

Re: [PHP] formating numbers & date

2002-12-04 Thread Jeff Bluemel
I'm displaying a date that I get from a informix database query - the date format is as follows; 2002-12-04 23:21:49 I want it to display as 12/4/2002 11:21:49 PM Jeff "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wednesday 04 December 2002

Re: [PHP] formating numbers & date

2002-12-03 Thread Jason Wong
On Wednesday 04 December 2002 08:29, Jeff Bluemel wrote: > ... but the date format doesn't seem to > allow me to pass it a date. Your code? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications

Re: [PHP] formating numbers & date

2002-12-03 Thread Jeff Bluemel
hp.net > > -Kevin > > > - Original Message - > From: "Jeff Bluemel" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, December 03, 2002 1:11 PM > Subject: [PHP] formating numbers & date > > > > I'm curious how I ch

Fw: [PHP] formating numbers & date

2002-12-03 Thread Kevin Stone
IL PROTECTED]> Sent: Tuesday, December 03, 2002 1:11 PM Subject: [PHP] formating numbers & date > I'm curious how I change the number of decimal places displayed, and also > changing the date / time structures before displaying them with an echo > command. > > Je

[PHP] formating numbers & date

2002-12-03 Thread Jeff Bluemel
I'm curious how I change the number of decimal places displayed, and also changing the date / time structures before displaying them with an echo command. Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Formating datevariables...

2002-07-22 Thread John Holmes
> I have a column in a mysql table with a timestamp. The value of this > column > is for instance: > > 20020722185242 > > How do i change the format on this to "DDMM" (22072002) in php? SELECT DATE_FORMAT(date_column,'%d%m%Y') AS Formatted_Date FROM your_table There's no need to involve PH

RE: [PHP] Formating datevariables...

2002-07-22 Thread Martin Towell
s S. Kelly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 23, 2002 9:51 AM To: 'Ragnar'; [EMAIL PROTECTED] Subject: RE: [PHP] Formating datevariables... Why not let mysql do it? It has a function do to exactly that, I think... But php's date() is the function you're looking

Re: [PHP] Formating datevariables...

2002-07-22 Thread Jeremy
Is the timestamp in UNIX format? if yes, try date() http://www.php.net/manual/en/function.date.php if no, try substr() hope that helps :) - Jeremy - Original Message - From: "Ragnar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 23, 2002

RE: [PHP] Formating datevariables...

2002-07-22 Thread Wouter van Vliet
lto:[EMAIL PROTECTED]] Verzonden: dinsdag 23 juli 2002 01:51 Aan: 'Ragnar'; [EMAIL PROTECTED] Onderwerp: RE: [PHP] Formating datevariables... Why not let mysql do it? It has a function do to exactly that, I think... But php's date() is the function you're looking for... -Orig

RE: [PHP] Formating datevariables...

2002-07-22 Thread David Buerer
Select TIMESTAMP(date_column) AS mydate Then when you display it use the date function DATE('mdY',mydate) -Original Message- From: Ragnar [mailto:[EMAIL PROTECTED]] Sent: Monday, July 22, 2002 4:42 PM To: [EMAIL PROTECTED] Subject: [PHP] Formating datevariables...

RE: [PHP] Formating datevariables...

2002-07-22 Thread Demitrious S. Kelly
Why not let mysql do it? It has a function do to exactly that, I think... But php's date() is the function you're looking for... -Original Message- From: Ragnar [mailto:[EMAIL PROTECTED]] Sent: Monday, July 22, 2002 4:42 PM To: [EMAIL PROTECTED] Subject: [PHP] Formating dat

[PHP] Formating datevariables...

2002-07-22 Thread Ragnar
I have a column in a mysql table with a timestamp. The value of this column is for instance: 20020722185242 How do i change the format on this to "DDMM" (22072002) in php? Thanx -R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] formating numbers

2001-08-24 Thread Jack Dempsey
urday, August 25, 2001 12:23 AM To: lista php Subject: [PHP] formating numbers Hi people! I'm trying to migrate my site from perl to PHP4. The question is how I get numbers look like this: 0001, 0002, etc Thanks for your time & help Javier Bellido -- PHP General Mailing List (http

[PHP] formating numbers

2001-08-24 Thread Javier Bellido
Hi people! I'm trying to migrate my site from perl to PHP4. The question is how I get numbers look like this: 0001, 0002, etc Thanks for your time & help Javier Bellido -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

RE: [PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread Adrian Ciutureanu
http://php.net/number_format > -Original Message- > From: Tim Olsen [mailto:[EMAIL PROTECTED]] > Sent: 18 iulie 2001 10:52 > To: [EMAIL PROTECTED] > Subject: [PHP] formating numbers to two decimal points - money - best > ways > > > Anyone have functions f

Re: [PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread David Robley
On Wed, 18 Jul 2001 17:21, Tim Olsen wrote: > Anyone have functions for formatting numbers being multiplied by > variables and whatnot to two decimal points - rounded up? As for > displaying total cost, etc? PHP has :-) have a look at the mathematical functions. http://www.php.net/manual/en/ref.

[PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread Tim Olsen
Anyone have functions for formatting numbers being multiplied by variables and whatnot to two decimal points - rounded up? As for displaying total cost, etc? _ Get your FREE download of MSN Explorer at http://explorer.msn.com --

Re: [PHP] formating output

2001-02-28 Thread Chris Lee
some code snipits would help, but lets see what we can do. I like arrays, they work for me, there are lots of ways todo things, arrays will help. echo "{$headline[0]}Latest news blah blah \n"; echo "{$headline[1]}Latest news blah blah \n"; echo "{$headline[2]}Latest news blah blah \n";

[PHP] formating output

2001-02-28 Thread george
I am developing a site which will have a web based admin panel, just now you can alter the scrolling headlines through the panel. But I want to be able to let the user modify, delete and create new headline, this isnt proble but i dong know how to format the output. What i want is for it to