PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > seoparator
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
seoparator

Réponse
 
LinkBack Outils de la discussion
Vieux 23/08/2007, 11h55   #1
coolcoder
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut seoparator


Was wondering if anyone could me with this little problem I'm having.
I'd like to have a comma separator after every 3 digits. E.g "3,000,000".
How would i go about this?






www.coderewind.com
Best Place to hunt for Code
--
View this message in context: http://www.nabble.com/seoparator-hel...html#a12291343
Sent from the MySQL - General mailing list archive at Nabble.com.

  Réponse avec citation
Vieux 23/08/2007, 12h47   #2
Terry Riley
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: seoparator

Not really a MySQL problem, this is a presentation problem. MySQL will
store the number as digits only (unless you are storing in a character
field - but why would you?). If using PHP, for instance, the output of
the field would be

number_format($fieldvalue)

or if you want the answer to two decimal places

number_format($fieldvalue, 2)


Regards
Terry
http://booksihaveread.awardspace.co.uk
----- Original Message -----

> *From:* coolcoder <bless1_4u@hotmail.com>
> *To:* mysql@lists.mysql.com
> *Date:* Thu, 23 Aug 2007 03:55:27 -0700 (PDT)
>
> Was wondering if anyone could me with this little problem I'm
> having.
> I'd like to have a comma separator after every 3 digits. E.g
> "3,000,000".
> How would i go about this?
>
>
>
>
>
>
> www.coderewind.com
> Best Place to hunt for Code
> --
> View this message in context:
> http://www.nabble.com/seoparator-hel...html#a12291343
> Sent from the MySQL - General mailing list archive at Nabble.com.
>



--
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.484 / Virus Database: 269.12.2/967 - Release Date: 22/08/2007 18:51


  Réponse avec citation
Vieux 23/08/2007, 14h19   #3
Andrew Braithwaite
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: seoparator

mysql> select format(3000000,0);
+-------------------+
| format(3000000,0) |
+-------------------+
| 3,000,000 |
+-------------------+
1 row in set (0.00 sec)

mysql> select format(3000000,2);
+-------------------+
| format(3000000,2) |
+-------------------+
| 3,000,000.00 |
+-------------------+
1 row in set (0.00 sec)

Cheers,

Andrew

-----Original Message-----
From: coolcoder [mailto:bless1_4u@hotmail.com]
Sent: Thu, 23 August 2007 11:55
To: mysql@lists.mysql.com
Subject: seoparator


Was wondering if anyone could me with this little problem I'm
having.
I'd like to have a comma separator after every 3 digits. E.g
"3,000,000".
How would i go about this?






This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
  Réponse avec citation
Vieux 24/08/2007, 23h18   #4
Terry Riley
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: seoparator

Learn something every day.....

TFT

----- Original Message -----

> *From:* "Andrew Braithwaite" <andrew.braithwaite@lovefilm.com>
> *To:* "coolcoder" <bless1_4u@hotmail.com>, <mysql@lists.mysql.com>
> *Date:* Thu, 23 Aug 2007 14:19:25 +0100
>
> mysql> select format(3000000,0);
> +-------------------+
> | format(3000000,0) |
> +-------------------+
> | 3,000,000 |
> +-------------------+
> 1 row in set (0.00 sec)
>
> mysql> select format(3000000,2);
> +-------------------+
> | format(3000000,2) |
> +-------------------+
> | 3,000,000.00 |
> +-------------------+
> 1 row in set (0.00 sec)
>
> Cheers,
>
> Andrew
>
> -----Original Message-----
> From: coolcoder [mailto:bless1_4u@hotmail.com]
> Sent: Thu, 23 August 2007 11:55
> To: mysql@lists.mysql.com
> Subject: seoparator
>
>
> Was wondering if anyone could me with this little problem I'm
> having.
> I'd like to have a comma separator after every 3 digits. E.g
> "3,000,000".
> How would i go about this?
>
>
>
>
>
>
> This message has been scanned for viruses by BlackSpider MailControl
> - www.blackspider.com
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=moscow@cix.co.uk
>
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.484 / Virus Database: 269.12.2/967 - Release Date:
> 22/08/2007 18:51
>
>



Terry
http://booksihaveread.awardspace.co.uk


--
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date: 23/08/2007 16:04


  Réponse avec citation
Vieux 08/09/2007, 11h51   #5
coolcoder
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: seoparator


Thanks for the i have got it correct.
--
View this message in context: http://www.nabble.com/seoparator-hel...html#a12568601
Sent from the MySQL - General mailing list archive at Nabble.com.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h48.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10407 seconds with 13 queries