I did try using LSParseNumber in my error catching,
but that didn't work out completely...don't remember
why at this point...
I need to be able to catch an input problem and return
an appropriate error message.
CFIF Not Len(Trim(Form.Dollar_Amount))
- Good for catching no entry
CFIF Len(Trim(Form.Dollar_Amount)) and Not IsNumeric(Form.Dollar_Amount)
- Good for catching just junk entries like, sadfsdd, but also catches
1,000
CFIF Len(Trim(Form.Dollar_Amount)) and Not
IsNumeric(LSParseNumber(Form.Dollar_Amount))
- Now why didn't this work? Oh, now I remember...a junk entry like,
asdflkj, can't
be parsed by LSParseNumber and throws a CF error...
CFIF Len(Trim(Form.Dollar_Amount)) and Not
IsNumeric(LSParseNumber(Val(Form.Dollar_Amount)))
- Worked for entries like 1,000 but didn't work with junk entries, like
sldifjo,
because I think Val created a value of 0 for the string
So...
I need to trap no entries, entries of junk, and not trap entries with commas
and strictly numeric entries
(without commas)
I just haven't been able to put together a sequence of traps for all entry
possiblities...maybe I've
been working on it too long for now...
Rick
> -----Original Message-----
> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 12:35 AM
> To: CF-Talk
> Subject: RE: Ok, I give...how can I do this...
>
>
> Nope, comma's never been part of a number in CF... It uses US
> formatted numbers (as far as I'm aware), but discluding commas. I
> believe this is a pretty standard format for numbers in computing
> languages... But because humans like to format their numbers we have
> LSParseNumber() and LSParseCurrency() to convert user-provided values
> with commas and such into machine numbers with the appropriate format
> for CF to treat them as numeric values. I don't use LSParseNumber() or
> LSParseCurrency() myself as I don't prefer to rely on CF's
> localization features, partly because they don't allow you to override
> the default locale without _setting_ the default locale using
> SetLocale() so I implemented my own localization methods using Java
> which accept the locale as an optional argument with a request-based
> default.
>
> > I have to snicker at the irony of this being a *new*
> > bug in CF7...I'm still using 4.5.2! :o)
>
> > Rick
>
>
> >> -----Original Message-----
> >> From: Eric Roberts
> >> [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, March 06, 2006 10:30 PM
> >> To: CF-Talk
> >> Subject: RE: Ok, I give...how can I do this...
> >>
> >>
> >> I think it should. I have been having similar probs
> >> lately with CF7 where
> >> numbers that have commas in them are viewed as strings.
> >> I don't ever
> >> remember having this prob with previous versions...is
> >> this a new
> >> bug in 7?
> >>
> >> Eric
> >>
> >> -----Original Message-----
> >> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, 06 March 2006 17:56
> >> To: CF-Talk
> >> Subject: Ok, I give...how can I do this...
> >>
> >> Should a field entry of "1,000" validate as a numeric?
> >>
> >> e.g. IsNumeric(Form.Dollars)
> >>
> >> (Where Form.Dollars has a value of "1,000)
> >>
> >> Rick
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
>
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234410
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54