Yes. This is a terribly annoying problem. Oh well, that's what happens
when there's only one number type.
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 10:03 PM
To: CF-Talk
Subject: Re: mySQL equivalent of MS Access Money
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 7:44 PM
To: CF-Talk
Subject: mySQL equivalent of MS Access Money fieldtype?
Hi, all.
What's the best mySQL fieldtype to use for money?
Rick
://mysecretbase.com
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 16, 2002 7:44 PM
To: CF-Talk
Subject: mySQL equivalent of MS Access Money fieldtype?
Hi, all.
What's the best mySQL fieldtype to use for money?
Rick
Quoting Rick Faircloth [EMAIL PROTECTED]:
I'll go with INT...what does the unsigned part mean
and what are the implications of signed or unsigned?
http://www.mysql.com/doc/en/Numeric_types.html
BTW, your original question is answered there as well.
Jochem
Quoting Rick Faircloth [EMAIL PROTECTED]:
I'll go with INT...what does the unsigned part mean
and what are the implications of signed or unsigned?
http://www.mysql.com/doc/en/Numeric_types.html
BTW, your original question is answered there as well.
Just to add
INT is INTEGER
of the decimal?
Rick
-Original Message-
From: Matt Robertson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 3:17 AM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
I use INT (unsigned) for ALL numerica vals and remove all other parms in
the field spec
to change everything I've done.
Measure twice, cut once...
Thanks for your help.
Rick
-Original Message-
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 9:32 AM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
Quoting Rick
On Tuesday, Dec 17, 2002, at 07:41 US/Pacific, Stephen Moretti wrote:
INT is INTEGER which means that there's no decimal places Not
much good
for real money that I'm afraid.
Integer is the safer way to represent money - as pennies - because that
way you avoid rounding errors. Financial
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 12:26 PM
To: CF-Talk
Subject: Re: mySQL equivalent of MS Access Money fieldtype?
On Tuesday, Dec 17, 2002, at 07:41 US/Pacific, Stephen Moretti wrote:
INT is INTEGER which means
did you try the float type
- Original Message -
From: Rick Faircloth [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 1:09 PM
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
I'm running into some of the very problems you mention.
I tried
I tried Integer, but when, for example, 100.50 gets entered into a
formfield,
then inserted into the db, it gets truncated to 100. How do I set up
Integer
to retain 2 decimal places?
Multiply the number by 100.
Also, I'm trying to setup the mySQL db fieldtype and CF processing
such that
, Inc.
http://mysecretbase.com
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 9:26 AM
To: CF-Talk
Subject: Re: mySQL equivalent of MS Access Money fieldtype?
On Tuesday, Dec 17, 2002, at 07:41 US/Pacific, Stephen Moretti wrote:
INT
-Original Message-
From: Rick Faircloth [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 10:10 AM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
I'm running into some of the very problems you mention.
I tried Decimal as the field type, but 100.5 gets
page.
Clues?
Rick
-Original Message-
From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 12:26 PM
To: CF-Talk
Subject: Re: mySQL equivalent of MS Access Money fieldtype?
On Tuesday, Dec 17, 2002, at 07:41 US/Pacific, Stephen Moretti wrote:
INT
]]
Sent: Tuesday, December 17, 2002 1:26 PM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
Sean wrote:
Integer is the safer way to represent money - as pennies -
because that way you avoid rounding errors.
Bingo. Sorry I didn't think to mention that last nite. 'twas a bit
good so far.
Are there any pitfalls that I'm overlooking?
Rick
-Original Message-
From: Costas Piliotis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 1:47 PM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
If I'm not mistaken, there's a float
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
Thanks for the tip, Costas and everyone.
Here's what appears to be finally working:
mySQL fieldtype set to: Decimal (2 decimals)
For outputting to screen:
CFOUTPUT#DollarFormat(Val(LSParseCurrency(Form.UCPaymentAmount)))#/CFOUTP
UT
Samuel R. Neff wrote
If the goal is to replicate MS Access Money field exactly,
I fortunately don't need calculation precision down that far, so I just stick to
dollars and cents. But it brings up a useful point: if you do need to keep track of
10ths, 100ths, 1000ths's of a
]]
Sent: Tuesday, December 17, 2002 3:19 PM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
I'd also test for european number formats. Remember that $1.00 in US is
$1,00 in Europe... That's really where the LSParseCurrency function shines
(I think)...
-Original Message
:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 2:23 PM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
Samuel R. Neff wrote
If the goal is to replicate MS Access Money field exactly,
I fortunately don't need calculation precision down that far, so
I just stick
At 10:38 AM 12/17/2002, you wrote:
(snip)
cfset form.value=form.value*100
If the goal is to replicate MS Access Money field exactly, then you
multiple by 1 before inserting into db and divide by 1 when
retrieving. MS Access Money field supports 4 decimal places using fixed
point data
Costas Piliotis wrote
#val(Form.UCPaymentAmount)#
Agh... (sound of head bonking against wall)
Of course val() would be a lot better than using replace() to strip out non-numeric
stuff. What was I thinking when I coded that?
---
Matt Robertson, MSB Designs,
Sean A Corfield wrote:
Integer is the safer way to represent money - as pennies - because that
way you avoid rounding errors. Financial applications should never use
floating point to represent dollars (or whatever). If you take 0.00 and
add 0.01 a hundred times, you're quite likely to
for that now. But will you in the future?
-Kevin
-Original Message-
From: Matt Robertson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 2:23 PM
To: CF-Talk
Subject: RE: mySQL equivalent of MS Access Money fieldtype?
Samuel R. Neff wrote
If the goal is to replicate MS
Jochem wrote:
snip
You always have to check the manual, because even with
operations involving 2 exact numeric values the outcome is
often implementation-defined.
Indeed. I have a client whose in-house service system relies on a rdbms that stores
all numeric values to something like 13
On Tuesday, Dec 17, 2002, at 14:48 US/Pacific, Jochem van Dieten wrote:
I believe the rounding baheviour of SQL is not specified to the point
where you can say a priori that math will not introduce errors with any
datatype. You always have to check the manual, because even with
operations
Hi, all.
What's the best mySQL fieldtype to use for money?
Rick
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4
27 matches
Mail list logo