If you take a large number in a text field and then use AS_NUMBER to convert it to a number, the number that is output is floating point not an integer. Is there a way to convert that floating point number to an integer? Or better convert the text to an integer from the outset?
What is actually being attempted here is the stripping of any leading zeros from a telephone number in order to parse it ready for a REST API but there may not always be a leading zero
[SOLVED] AS_NUMBER to Integer
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
[SOLVED] AS_NUMBER to Integer
Last edited by PointsWell on Tue May 29, 2018 5:34 am, edited 1 time in total.
Re: AS_NUMBER to Integer
a regular expression can also search for 0 or more 0's only at the beginning of a line.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: AS_NUMBER to Integer
Doh Good ol' uncle Regex to the rescue again.Jaymer wrote:a regular expression can also search for 0 or more 0's only at the beginning of a line.
I used the following:
Code: Select all
REPLACE_PATTERN(PhoneRecords.Number, '\A[0]', '')