mcstar Posted August 15, 2005 Posted August 15, 2005 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
-Queue- Posted August 15, 2005 Posted August 15, 2005 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.
comment Posted August 15, 2005 Posted August 15, 2005 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.
DLS Posted August 18, 2005 Posted August 18, 2005 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.
SurferNate Posted November 16, 2005 Posted November 16, 2005 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.
Newbies yoyomaster Posted December 7, 2005 Newbies Posted December 7, 2005 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 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.
stanley Posted December 7, 2005 Posted December 7, 2005 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 yoyomaster Posted December 7, 2005 Newbies Posted December 7, 2005 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.
CoZiMan Posted December 11, 2005 Posted December 11, 2005 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
Recommended Posts