Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Extract number from text string


gbenic

Recommended Posts

Precision for my post:

 

the numbers are not always at the same position in the text strings.

 

Thanks

 

gbenic

Link to comment
Share on other sites

If you wish only whole numbers (integers), you can use the "Abs" function as in:

 

TextToNumber(Abs(TextField))

 

Tom

Link to comment
Share on other sites

A couple of notes...

 

1) If a hyphen (-) precedes the number, the TextToNum function will interpret the number as negative. [ "A test - my number is $12.04" -- will return -12.04 ]

 

2) If more than one number is in the text string, they will be concatenated and the decimal seperator may be dropped. [ "A test of 2 (two) numbers is $3.04" -- will return 2304 whereas; "A test of two numbers - $3.04 and 56" -- will return -3.0456]

 

Also a correction to Tom's comment - ABS (absolute value) returns a positive value [good for removing those preceding hyphens] where as the INT (integer) function would return a whole number.

Link to comment
Share on other sites

  • 5 years later...

I saw this excellent post and I think this could help me however I don't have the texttonum function. Is this because I'm not running Filemaker Advanced? At least I don't think I am. If I go to "About Filemaker" would it say Filemaker Advanced if that is what I have? Thank you.

Link to comment
Share on other sites

Top Menu in FM: Help ----> "Filemaker Pro Advanced Help" vs Help ----> Filemaker Pro Help

 

 

You could also use the Filter (text string;"1234567890") to get the number. But this will return all the numbers in the test string.

 

Example: "Bill has 25 tomatoes in his Audi A4" returns 254

Link to comment
Share on other sites

I saw this excellent post and I think this could help me however I don't have the texttonum function. Is this because I'm not running Filemaker Advanced?

 

 

No, it's because you are replying to a 6-year-old post that was written back when FileMaker 6 was the hot new product on the block.

 

The TextToNum() function's functionality is represented in the modern world by GetAsNumber (), which Josh (jmormond) points you towards in the post above.

Link to comment
Share on other sites

  • 2 months later...


×
×
  • Create New...

Important Information

Terms of Use