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
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 i
Jochem wrote:
>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 decimal
055. As you
>say, you may not need to account 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
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 t
At 10:38 AM 12/17/2002, you wrote:
>(snip)
>
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 type.
~~
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,
obertson [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 Access Money field exactly,
>
> I fortunatel
lto:[EMAIL PROTECTED]]
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 func
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 cent/pence/zlotyc
o: CF-Talk
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:
#DollarFormat(Val(LSParseCurrency(Form.UCPaymentAmo
--
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 or decimal data type in mysql...
Trying to remember off the top of my head.
and set for a
precision of, say, 8,2.
Cheers,
--Matt Robertson--
MSB Designs, 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&
ginal 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 that the
002 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 rounded up to
101.00...not good.
I tried Integer, but when, for example, 10
s,
--Matt Robertson--
MSB Designs, 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:
> 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
> suc
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
MAIL 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 that there's no decimal places Not
> much goo
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. Financia
r that I missed one little aspect of the situation
that requires me 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
aren't zero to the right 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
> 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
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
~
w.
--Matt Robertson--
MSB Designs, Inc.
http://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.
-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 f
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=subscribe&forumid=4
FA
27 matches
Mail list logo