August 20, 201312 yr 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.
August 20, 201312 yr 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.
August 20, 201312 yr 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.
August 20, 201312 yr Solution Why not simply format the field to display the " as a trailing currency symbol?
August 20, 201312 yr 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.
Create an account or sign in to comment