Ok, this is darn peculiar :-b
Why would there be a "num:comma-integer" format if they are not going to
allow comma in an integer field ???

This I think is a bug

---Debug output of TestSimleFormat.taf
150,000 = 150,000 FORMAT="num:simple-integer"
250,000 = 250,000 FORMAT="num:comma-integer"
350,000 = 350,000 FORMAT STR=request$fnumber
INFORMAT="num:comma-integer" FORMAT="num:simple-integer"
450,000 = 450,000 FORMAT STR=request$fnumber FORMAT="num:simple-integer"
450000.00 = 450000 FORMAT STR=request$fnumber FORMAT="num:,,0,,,,-,"
150,000 = 450,000 FORMAT="num:,,0,,,,-," 
------------------------------------------------------------------------
--------
[Application File] [4] START /testsimpleformat.taf Witango_Server_5  
[Results Action] [4] Results  
[Warning] [5] VAR: input text not valid, text not formatted 
[Warning] [5] VAR: input text not valid, text not formatted 
[Warning] [5] FORMAT: input text not valid, text not formatted 
[Warning] [6] FORMAT: input text not valid, text not formatted 
[Warning] [6] VAR: input text not valid, text not formatted 
[Changed Vars] [6] request$fnumber=450000; request$mynumber=250,000;
request$thenumber=450,000;  
[request$ Vars] [6] variableTimeout=30; fnumber=450000;
thenumber=450,000; mynumber=250,000;  

Ben Johansen - http://www.pcforge.com
Authorized Witango Reseller http://www.pcforge.com/WitangoGoodies.htm 
Authorized MDaemon Mail Server Reseller
http://www.pcforge.com/AltN.htm


-----Original Message-----
From: Bryan Hughes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 04, 2003 2:30 PM
To: [EMAIL PROTECTED]
Subject: Re: Witango-Talk: Format NUM

Scott,

No worries :)

Just to recap this isn't a database issue it's a Witango issue with the

Format attribute giving an error when trying to convert 350,000 to  
350000 (without the thousands separator) using  
FORMAT="num:simple-integer".

Stefan and Scott's suggestions seem to work, thanks guys.

If anyone know's why the above format attribute kicks the error I would

greatly appreciate some enlightenment.

B


On Thursday, September 4, 2003, at 05:19 PM, Scott Cadillac wrote:

> My apologies Bryan,
>
> I think I got your question backwards - second time I did that today  
> (an
> off-line conversation) :-P
>
> I read a great quote earlier today "What we need is a fountain of  
> smart --
> we've got enough youth..." - thanks David Thomas. This certainly  
> applies to
> me today - I guess I was too late last night working....
>
>
> Anyway, "removing" formatting is something that doesn't come up to  
> often,
> but Stefan's suggestion earlier is a good one:
>
> <@keep @@mynumber "0123456789">
>
> The example in the documentation doesn't specifically show how it  
> deals with
> thousand separators, so it's hard to tell how it's meant to work in  
> this
> case.
>
> As well, it appears the FORMAT="num:simple-integer" doesn't account
for
> rounding, so you could also get the equivalent by doing something like

> the
> following:
>
> <@CALC EXPR='floor(<@VAR local$mynumber>)'>
>
> Hope this helps. Cheers....
>
> Scott Cadillac,
> Witango.org - http://witango.org
> 403-281-6090 - [EMAIL PROTECTED]
> --
> Information for the Witango Developer Community
> ---------------------
>
> XML-Extranet - http://xmlx.ca
> 403-281-6090 - [EMAIL PROTECTED]
> --
> Well-formed Development (for hire)
> ---------------------
>
>
>> -----Original Message-----
>> From: Bryan Hughes [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, September 04, 2003 2:43 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: Witango-Talk: Format NUM
>>
>>
>> Scott,
>>
>> The database is MySQL with the column datatype of bigint.
>>
>> The insert statement is UNquoted since it is not a string.
>> Yes there is a database problem, but I'm trying to prevent
>> that problem
>> with the format attribute that isn't working.
>>
>> I am familiar with databases and datatypes and how to
>> properly insert
>> data into them. I'm using Witango to properly format that
>> data but it
>> doesn't seem to be working as documented.
>>
>> I'm needing to format the number into an INTEGER which is what I
>> thought "num:simple-integer" should do.
>>
>> Any ideas as to why Witango isn't formatting and giving an error?
>>
>> -B
>>
>> On Thursday, September 4, 2003, at 03:22 PM, Scott Cadillac wrote:
>>
>>> Hi Bryan,
>>>
>>> Your error message sounds like something from the database,
>> but you
>>> didn't
>>> mention what kind you have.
>>>
>>> For healthy database storage purposes, don't store your number with
>>> pretty-printed formatting.
>>>
>>> Most databases will use a different format for the raw
>> storage of the
>>> value
>>> then what you often see from your database GUI manager. This is
>>> especially
>>> true for "datetime" fields.
>>>
>>> If the field is a "number" type of some kind, then feed it
>> a proper
>>> number.
>>> As far as most databases are concerned, a value like 350,000 is a
>>> string so
>>> it'll complain.
>>>
>>> As well, SQL doesn't typically use quotes for number values (SQL
>>> generated
>>> by Witango or otherwise), so having a comma present in a
>> number value
>>> will
>>> likely break your SQL statement.
>>>
>>> Apply the formatting on the read from the database, something like:
>>>
>>> <@COLUMN "table.field" FORMAT="num:simple-integer">
>>>
>>> Or use a "text" type field for storing your value, but then
>> you won't
>>> be
>>> able to query the field like a true number anymore.
>>>
>>> Hope this helps. Cheers.....
>>>
>>> Scott Cadillac,
>>> Witango.org - http://witango.org
>>> 403-281-6090 - [EMAIL PROTECTED]
>>> --
>>> Information for the Witango Developer Community
>>> ---------------------
>>>
>>> XML-Extranet - http://xmlx.ca
>>> 403-281-6090 - [EMAIL PROTECTED]
>>> --
>>> Well-formed Development (for hire)
>>> ---------------------
>>>
>>>> -----Original Message-----
>>>> From: Bryan Hughes [mailto:[EMAIL PROTECTED]
>>>> Sent: Thursday, September 04, 2003 12:51 PM
>>>> To: [EMAIL PROTECTED]
>>>> Subject: Witango-Talk: Format NUM
>>>>
>>>>
>>>> I'm trying to format a number before insert into a database.
>>>>
>>>> The input number would be something like "350,000".
>>>>
>>>> <@VAR mynumber FORMAT="num:simple-integer">
>>>>
>>>> But getting an error on execution: input text not valid, text not
>>>> formatted.
>>>>
>>>> And the database action is getting an error because the
>> comma in the
>>>> numbers throws off the number columns in the insert.
>>>>
>>>> What does the error "input text not valid, text not
>> formatted" mean,
>>>> what's causing it.
>>>>
>>>> ______________________________________________________________
>>>> __________
>>>> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>>>>
>>>
>>>
>> ______________________________________________________________
>> _________
>>> _
>>> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>>>
>>
>> ______________________________________________________________
>> __________
>> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>>
>
>
_______________________________________________________________________ 
> _
> TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf
>

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/maillist.taf

Attachment: TestSimpleFormat.taf
Description: Binary data

Reply via email to