Jump to content
Server Maintenance This Week. ×

Limit number field to 0 decimal places


This topic is 2322 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Is there a way within filemaker to limit the decimal places in a number field to 0? I'm trying to create a field where in if a user enters 100.4 it will set the value to 100 and not allow any decimal places.

I see you can do this in the inspector but I don't think it actually changes the data within the field.

 

Thanks

 

Link to comment
Share on other sites

There's a number function called Int (number) which strips off any decimal portion leaving just the integer part. 

 

In your example, Int ( 100.4 ) = 100

Edited by NLR
Link to comment
Share on other sites

49 minutes ago, wattmhite said:

Is there a way within filemaker to limit the decimal places in a number field to 0? I'm trying to create a field where in if a user enters 100.4 it will set the value to 100 and not allow any decimal places.

I see you can do this in the inspector but I don't think it actually changes the data within the field.

 

Thanks

 

As NLR suggested, use int () function in a simple script and trigger it on the target field "on save" trigger option. 

 

So the script would be like 

 

Set field [target table::target field ; int (target table::target field)]

 

Or

Set field [target table::target field ; int (Self)]

 

Edited by siroos12
Link to comment
Share on other sites

This topic is 2322 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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