Cat Posted October 6, 2023 Share Posted October 6, 2023 At some point I found instructions showing me a Rule interface that looked exactly like a text frame control. This allowed for the creation of formatted text to be chosen like a Rule and placed into a text frame. The problem I'm trying to figure out is how to have superscript $ and cents so that $5.00 would have tiny dollar sign and cents value. Ideally as a single rule to be placed into a text frame so it can be controlled as a single object. I have tried to search in the Forums and I keep getting the same cases listed on almost all the links retired in the search. No matter how I phrase my request. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted October 6, 2023 Share Posted October 6, 2023 You might be thinking of "Create Resources" in the Steps palette. Add / Formatted Text / Edit. Even if you go this route though, if your data has embedded $ or cents, you will still need a rule to setup the superscript. I think I would forgo that and just setup a formatting rule for your amount field like this: var amount = Field("Amount").replace(/[^0-9.,]/g, "").split("."); return '<superscript>$</superscript>' + amount[0] + '<superscript>' + amount[1] + '</superscript>'; This calls in your amount, removes any non numerical entity, like a dollar sign, then splits it into an array with 2 sections at the decimal point. Then you are returning a superscript $, the dollar amount (at index 0), then superscript cents (at index 1). 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.