|
Home > Archive > MySQL ODBC Connector > September 2005 > money fields
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
|
| Daniel Kasak 2005-09-26, 8:24 pm |
| Chris Ripley wrote:
>What's a good (or best) field type for money or
>currency data. Mysql doesn't have a MONEY type for
>structure, so what would I have the best luck with?
>
>
>
double
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@nusconsulting
.com.au
website: http://www.nusconsulting.com.au
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
| |
|
|
| Peter Brawley 2005-09-26, 8:24 pm |
| Chris,
>What's a good (or best) field type for money or
>currency data. Mysql doesn't have a MONEY type for
>structure, so what would I have the best luck with?
Someone suggested double, but with big sums that can give you rounding
errors. Try DECIMAL.
PB
>
>
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.6/111 - Release Date: 9/23/2005
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
| |
| Daniel Kasak 2005-09-26, 8:24 pm |
| Jasper Bryant-Greene wrote:
> No way. You should *never* use floating-point types for currency if
> you care about precision. You'll experience all sorts of weird
> rounding and comparison errors. See [1] for more information.
>
> DECIMAL would suit your needs better -- from [2]: "The DECIMAL and
> NUMERIC types [...] are used to store values for which it is important
> to preserve exact precision, for example with monetary data."
>
> [1] http://en.wikipedia.org/wiki/Floating_point
> [2] http://dev.mysql.com/doc/mysql/en/numeric-types.html
I see.
Back to the drawing board then. I'm *sure* I saw someone else recommend
that ... many years ago now.
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@nusconsulting
.com.au
website: http://www.nusconsulting.com.au
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw
|
|
|
|
|