List:General Discussion« Previous MessageNext Message »
From:SGreen Date:May 14 2004 5:30pm
Subject:Re: Integers - How would you enter 112,249?
View as plain text  
<David Blomstrom wrote>
--- Joshua Beall <jbeall@stripped> wrote:

> AFAIK 112,249 is not an integer.  It is a string.
> If you need to have the
> commas, you need to store it as a string.

I haven't got to strings yet. The table I'm making is
for display purposes, so I want visitors to be able to
see 10,212, rather than 10212. I'm also going to make
JavaScript sortable columns.

So do I need to store it as a string if I want to
display columns? Or would I simply use some other
function to insert commas for display purposes?
</David>

David,

As several people have tried to point out, the data "112,249" represents a
string and not a number. The comma is killing you. How you store a number
INTERNALLY can be totally different than how you present it to the user.
For instance you could HEX() the number and get back "1B679", it's the same
number with a different look.

You can format your numbers on output however you like (with or without
commas, as a sequence of binary digits, as a date value, ....) but for the
import to work your data must not have commas in the number fields.

Respectfully,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine


Thread
Integers - How would you enter 112,249?David Blomstrom14 May
  • Re: Integers - How would you enter 112,249?Dan Nelson14 May
  • Re: Integers - How would you enter 112,249?Paul DuBois14 May
Re: Integers - How would you enter 112,249?Joshua Beall14 May
  • Re: Integers - How would you enter 112,249?David Blomstrom14 May
    • Re: Integers - How would you enter 112,249?Paul DuBois14 May
Re: Integers - How would you enter 112,249?SGreen14 May