Discussion:
data type to use to insert the comma in thousands?
(too old to reply)
Paul
2012-02-28 20:47:20 UTC
Permalink
Is there a datatype I can use so that mysql will insert the comma in
the thousands place?

For example my user enters 12500 I want the database to store it as
12,500

thanks
Bob Barrows
2012-02-28 21:01:26 UTC
Permalink
Post by Paul
Is there a datatype I can use so that mysql will insert the comma in
the thousands place?
For example my user enters 12500 I want the database to store it as
12,500
mysql? This is a sql server group.

Commas are a format attribute. Format is not an attribute of a number. it is
an attribute of a string (character data). A number cannot be stored with a
format attribute. You can only apply formats to numbers by converting them
to strings and applying the format to the string.

Loading...