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.

Accept Whole Numbers only FM11

Featured Replies

  • Newbies

Using FM 11, is there a way to allow only whole numbers to be entered by the user in a field?

While not being fully aware of the ramifications involved - could one way of dealing with it, be to stuff the fields autoenter option with an updating calc saying:

Round ( Self;0 )

--sd

Another calculation may be:

Int ( Self )

But with 11, you can trap for the decimal separator, so that nobody can enter that key into the field.

An OnObjectKeystoke trigger that fires a script like this:

If [ Code ( Get ( TriggerKeystroke ) ) = Code ( Left ( 1/2 ; 1 ) ) ]

Show Custom Dialog [ "Only whole number allowed" ]

Exit Script [ Result: 0 ]

End If

Hi mws120,

I would think that Round() and Int() makes an assumption because it can change the number entered. What are the business rules if someone enters 11.95?

1) Should the number be changed to 12? Use Søren's answer.

2) Should the number be changed to 1195? Use Filter ( Self ; "0123456789" )

3) Should the number be truncated to 11? Use Int(Self).

4) Or should the User be forced to correct it? Use script trigger on keystroke.

On 2, include minus if allowed. Also on the first three auto-enter options, set the auto-enter calculation by unchecking 'do not replace existing value'.

  • Author
  • Newbies

Thank you LaRetta

Good thinking "99" re "What are the business rules if someone enters 11.95?"

In this case, I'll be using either option 3 or 4 - but options 1 & 2 may be utilised for other situations as I continue building now that my eyes have been opened a bit more.

Thank you Søren, Danielle and LaRetta

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.