NUM_TO_TEXT and TEXT_TO_NUM?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

NUM_TO_TEXT and TEXT_TO_NUM?

Post by tkilshaw »

I need to be able to take some characters from a text attribute and convert them to numbers.

I can't see any way to do this currently. Type conversions involving strings and numbers cause the number to be converted to a string.

We could use explicit NUM_TO_TEXT and TEXT_TO_NUM functions

Terry
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Terry,

The system automatically handles type conversions between textual and numeric attributes. You can always assign a numeric value to a textual attribute. A textual value can be assigned to a numeric attribute if the text contains a valid representation of a number.

You can use the standard text manipulation functions to extract numeric bits from a text attribute and then assign the result to a numeric attribute.
Aware IM Support Team
tkilshaw
Posts: 170
Joined: Thu Jan 19, 2006 11:33 pm
Location: Western Canada
Contact:

Post by tkilshaw »

What you say is true but doesn't cover what I need. Suppose there is a text field that contains a number, MyTextField, whose value is '1.30 PM'

And a number field MyNumField that is undefined.

Suppose I want to set:

MyNumField = CHARS_FROM_LEFT( MyTextField, 5 ) + 12

I end up with an empty field.

I guess I could set:

MyNumField = CHARS_FROM_LEFT( MyTextField, 5 )

and then set

MyNumField = MyNumField + 12

I'll try that.

I'd prefer to have:

MyNumField = STRING_TO_NUM( CHARS_FROM_LEFT( MyTextField, 5 ) ) + 12

Please consider adding explicit STRING_TO_NUM( and NUM_TO_STRING_TO( functions.

Terry
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Terry,

Yes, I see your point. We have added the type conversion functions to our development list and will implement them shortly. We will post a message to this topic when the functions are available.
Aware IM Support Team
Post Reply