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 6230 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am using a calculation to pull some data from repeating fields and enter the data into a text field. I am using the GetRepetition function in the calculation, however, the result that I get in the text box does not include the number formatting from the Repeating Field, such as the $ symbol, or comma to mark 1000's. Any help would be appreciated. Thanks.

Posted

It seems like the numbers should appear right in the middle of some prose, if so wouldn't I use GetRepetition( but instead use the bracket notation in merge-fields, because it then keeps the field as number, and you by it can keep the formatting.

<> 

This grabs the 4th repetition!

--sd

Posted

Formatting is generally field level, so if you're putting a number into a text field, it won't keep the number formatting.

You can

1) Format the number via a calculation by adding the "$" in front of the GetRep and wrapping the GetRep in a calc that will give the comma in the right place and the correct number of decimals. It'll take some tweaking, but it can be done.

2) Use Soren's suggestion, which is useful if the result you want is for displaying on a layout only (not to use in further calculations or to e-mail, etc) where you use more than one calculation to assemble the text breaking the calc up where you want to insert the currency field and formatting that separately.

3) I haven't tested this , but if the currency fields are the only numbers in the calculation, I think you can drop the calc field as a merge field onto the layout and format the numbers that way.

Posted

I am not sure how to use it in a calculation.

So the prose is an e-mail or such? If you accidentally have forgotten to update you profile, and now rides on a adv/dev licence, could you use this CF:

http://edoshin.skeletonkey.com/formatting/index.html

Perhaps Agnés could untangle the recusions??

--sd

Posted

Oh yes! Much better indeed!

"You owe me "  & GetLayoutObjectAttribute ( "myRepeat";"content";4 ) & " - Please as soon as convenient!"

--sd

Posted

That is very interesting. However, it does require the formatted field to be present on the current layout, which may not always be convenient. In such cases, it might be preferable to use a merged field or, if merging is not possible, a text calculation that formats the number as currency.

Currency formatting in a text calculation has been disscussed many times, for example:

http://www.fmforums.com/forum/showpost.php?post/257391/

Posted

I was just pointing it out as an option. Pulling from an existing field object, (assuming it is already on the layout), has the advantage of following whatever formatting is on the original field, so if it is changed (eg, turn on red when negative), this calculation would automatically see that change too without having to modify some other mechanism to get the format to match up.

Most field layout objects and merge field layout objects can respond to "source" and "content" in a meaningful way, and I thought it would be helpful to point that out also.

Posted

Thanks for all of the responses - I've learned something from each of you. The Shadow's suggestion (GetLayoutObjectAttribute) was the easiest solution for me to implement and it worked perfectly.

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