Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hello Everyone,

 

I have a field that gives an image height, and an image width. What I am looking for is a way to type in a number and have the field automatically add a " to the end of the number. I believe this is done with a calculation field, but not positive.

 

Thanks in advance for any help.

Posted

Yes, you could define a calculation:   Height_inches:   Height & """

 

The backslash () allows you to escape the " in your calculation, thus adding a " in the text instead of acting as the end-of-text delimiter.

Posted

A consideration ...

 

If you create a calculation then that is fine but if you plan to do what you say which is "type in a number and have the field automatically add a " to the end of the number" meaning you want to use Auto-Enter (replace) calculation then it can be problem.  Using Height & """ can produce double quotes at the end so if you wish to use it as auto-enter then you might consider instead using:  

Let ( n = GetAsNumber ( Self ) ; n & """)

This will protect from getting double quotes if the field is changed.  But further, might we be able to skip all of this?  Do you really NEED a calculation field even?  If the inches are for display only then you can use merge field such as:  <<Height>>".  You can also use merge variable with conditional format for displaying more complex calculations.  Duplicating a field value (plus adding another calculation to your definitions) carries a cost whereas layout-level solutions are quite thrifty.

 

Just some ideas.

Posted

Oh!  Much better!

 

I also wanted to mention that, although FM allows text characters within a number field (where Height and Width should be number), it usually is best to keep number fields pure.

This topic is 4170 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.