AnsweredAssumed Answered

Review and Document the behaviour of GetAsNumber

Question asked by Malcolm on Oct 31, 2017
Latest reply on Nov 1, 2017 by TSGal

Product and version:

FileMaker Pro 16.0.3.302

 

OS and version:

Mac OS X 10.11.6

 

Hardware:

MacBook Pro (Retina, 15-inch, Mid 2015)

 

Description:

The behaviour of GetAsNumber is not fully documented and it is hard to understand what rules it is acting on.

 

The most notable omission is that GetAsNumber will return a negative when the text contains a number formatted with parentheses, e.g., GetAsNumber ("(9)") returns -9. This is not mentioned in the documentation

 

The behaviour of the function when handling numbers formatted in parentheses varies.

 

How to replicate

 

GetAsNumber("this.(9)") // .9

GetAsNumber("this(9)") // -9

GetAsNumber("this. (9)") // even with the space .9

GetAsNumber("(9)1")  // -91

 

GetAsNumber("1 this(9)")  // 19

 

Workaround (if any)

Use other text functions to obtain the correct string.

Outcomes