coy886 Posted August 20, 2013 Posted August 20, 2013 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.
Matthew F Posted August 20, 2013 Posted August 20, 2013 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.
LaRetta Posted August 20, 2013 Posted August 20, 2013 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.
LaRetta Posted August 20, 2013 Posted August 20, 2013 Oh geez ... even better of course ... GetAsNumber ( Self ) & """
comment Posted August 20, 2013 Posted August 20, 2013 Why not simply format the field to display the " as a trailing currency symbol?
LaRetta Posted August 20, 2013 Posted August 20, 2013 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now