Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

is there an IsNumber type of fn?

Featured Replies

Hi,

suppose that you have a field, say it's called Amount and you are doing your own validating of the field - not using filemakers built in validation features.

Your user types ? in the field. Is there a function which you can use to look at the fields to see if it's really a number/currency? Something like if [isNumber ( projects::amount ) = 1] ??

I looked through the help and did a search on this forum and I didn't see a solution.

thanks for the help in advance,

sincerely,

J__

IsValid(Amount) returns 0 if there is only text in the number field Amount.

Here's my test for numeracy. However, it does NOT work on a number field. It only correctly validates numbers entered in text fields (at least in FM6). The reason why? FileMaker's number processing makes certain "corrections" to invalid data. For example, if you enter a1.5d in a number field, or run that through NumToText(), it will evaluate as the number 1.5. Which kind of makes sense. What if they enter 123a5? Guess what -- that evaluates as 1235! It just ignores the letters. More annoying is that if they enter something like 12.2.1 (note the two decimal points) it ignores the second decimal point and evaluates it as 12.21. Similarly, it tosses out spaces, symbols... anything that's not a number. It keeps any numeric digits, and strings them together to form the final result.

comment's er.. comment is correct. IsValid(Amount) will tell you whether there's a number in the field or not. But it will only return 0 (false) if there are NO numbers in the field. As I've said above, if there are numbers (and other stuff) in the field, you might not get what you expect.

If you want to enter the number in a text field, you can use the following check to validate that it's a number, only has one decimal place, has no text in it, etc.

If(Left(TextField, 1) = "-",

NumToText(TextToNum("1" & Right(TextField, Length(TextField) - 1) & "1")) = ("1" & Right(TextField, Length(TextField) - 1) & "1"),

NumToText(TextToNum("1" & TextField & "1")) = ("1" & TextField & "1")

)

  • Author

IsValid - right! I knew there was something that did that, but I kept on thinking "IsNumber".

I'll check it out - thanks.

And underhat - thanks for your response, this may come in handy.

thanks,

Sincerely,

J__

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.