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
NUM_TO_TEXT and TEXT_TO_NUM?
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
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.
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
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
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
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact: