Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Preserve number or currency format from Repeating Field

Featured Replies

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.

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

  • Author

Thanks for your response. I understand the merge-field, but I am not sure how to use it in a calculation.

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.

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

Also, if you upgrade to a more recent version, you can use GetLayoutObjectAttribute(; "content") to pull the number and its format information out of the layout object.

Oh yes! Much better indeed!

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

--sd

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/

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.

Oh, it's definitely an option well-worth exploring - and not just for number formatting. Thanks again for pointing it out.

  • Author

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.