If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Storage comma instead of dot in numeric types

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-07, 09:58
Sergio Ramos Sergio Ramos is offline
Registered User
 
Join Date: Feb 2007
Posts: 1
Storage comma instead of dot in numeric types

IŽd like to know how to storage in MySQL numeric fields with comma intead of dot. Ex.: 1.000,00 instead of 1,000.00
Reply With Quote
  #2 (permalink)  
Old 02-14-07, 10:37
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
you cannot store them that way, but you can display them that way...
Code:
select replace(
       replace(
       replace(format(yourcolumn,2),'.','~')
                                   ,',','.')
                                   ,'~',',') as foo
  from ...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-14-07, 10:53
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,259
.....thats a presentation issue

so if you are using raw SQL as your front end (say int heMySQL command line, or a query browser, then Rudy's solution is correct, alternatively you should be using whatever your front end is to format the data as you expect. Normally this sort of issue would be covered by the client workstations internationalisation settings.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On