On 2/14/06, Roberto Perez <[EMAIL PROTECTED]> wrote:
> >On 2/14/06, Charlie Griefer wrote:
> >
> >remove any non-numeric characters (except for a decimal point) when
> >inserting the value into the database:
> >
> >rereplace(myNum, '[^0-9/.]', '', 'all')
> >
>
> Thanks. If I also wanted to remove any blank spaces (space bars), would this 
> code do that too (and I'm assuming this code would be placed in the INSERT or 
> UPDATE query)?
>
> Now, to read the resulting field from the database, is there an easy way to  
> convert "1250.00" to "1,250.00"?

that regex will remove anything that's not a number or a decimal point.

so yes, on INSERT/UPDATE, use the regex to insert only numeric values.

on display (after a SELECT), use numberFormat() or decimalFormat() to
present the value the way you want.


--
Charlie Griefer

================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232302
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to