Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I discovered this trick by accident when I saw that a merge field was displaying a simple number field as a percent.

Here is how to format the numeric merge field:

Go to Layout mode. Do not select an object. Choose Number from the Format menu and define the desired format for the numeric merge field, such as currency or percent.

Now select Merge from the Insert menu or use the Text tool to type in the merge field. Change to Browse mode and the merge field is formatted as desired!

Remember to reset the Number format to the default you normally want, such as General or Leave Data Formatted As Entered.

I confirmed that this merge field formatting trick works in both FM5.5 and FM7 on number, date and time fields.

Have Fun! -- Mark

Mark Conrad

Application Developer

Posted

You can also format the merge field after adding it, by right-clicking on it or the text block in which its contained and selecting Number/Date/Time Format, as is appropriate.

Posted

To be more precise: the formatting does not apply to the merge field, but to the text object containing it. There may be multiple number/date/time etc. merge fields in a single block, but only one format for each type.

Posted

Yes, so if you have numbers that are percentages and numbers that are dollars you can only choose one format. So, you have to have multiple lines of text/merge fields and line them up on your layout.

  • 2 months later...
Posted

Or, alternately, if mixed merge number formats are a problem, you can do an intermediate repeating calculated text field to do the formatting for you and then just pull each repetition as needed. You don't have to use the FM formatting palette. You can force any format with a calculation.

  • 3 weeks later...
  • Newbies
Posted

can anyone help me with some merge fields formatting issues?

the FMP 7 tutorial manual says, “Merge fields expand or contract to fit the data in the field, and take no space if the field is empty.”

and I find this to be true if for example I setup my merge fields like so:

<><>

<><>

<><>

this will give me this look if say for example [color:red]item2 is empty:P

item1item1info

item3item3info

this is great, but if I add spaces inbetween my merge fields such as:

<> <>

<> <>

<> <>

this will give me this look if say for example [color:red]item2 is empty:

item1 item1info

item3 item3info

for some reason whenever spaces are added in between the two merge fields, filemaker will no longer collapse if there are empty data fields.

does anyone know why this happens, or have you ever run into this problem? the FP7 tutorial file (MyFile10) has spaces and it works just fine. however if you manually add spaces and recreate this file, the collapsing no longer happens.

Thank you for anyone that can help me with this tiny bit of annoyance.

Posted

Actually, it's quite simple. The line "<> <>" contains a space, and that's what you're getting, even when item2 and item2info are empty. If you were to create a calculation field ("item2plus") which was defined as: item2 & " ", and used that instead, with the resulting format of: <><>, then the line would disappear & items 1 and 3 would be collapsed together, as you desire.

-Stanley

  • Newbies
Posted

good call Stanley. thank you for your help. i didn't realize the space was actually giving me the line break, well, because I couldn't see it. the calculation will work great.

Posted

Side note:

If you go to a calc field instead of merging then you have even more control over linebreaking and spaces with the very powerful 'substitute' and 'trim' commands. I find the different options for the trim command especially helpful, and substitute is great for paragraph breaks.

This is one powerful way to create multi-key fields :P

×
×
  • Create New...

Important Information

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