Superscript on Print Templates?

Does anyone know if it is possible to get numbers within a formula in a Print Template to display as superscript?

In other words, let’s asume we have the typical formula to display days as ordinals, where 1 shows as “1st”, 2 as “2nd”, and 3 as “3rd” ––––> $formula(isEmpty($contract_start_date)?"[Ordinal Day] day of [Month], [Year]": dateformat("d",$contract_start_date) + ((dateformat("dd",$contract_start_date))=="11"||(dateformat("dd",$contract_start_date))=="12"||(dateformat("dd",$contract_start_date))=="13" ? "th" : (((replace(dateformat("dd",$contract_start_date),".*(.)","$1"))=="1" ? "st" : ((replace(dateformat("dd",$contract_start_date),".*(.)","$1"))=="2" ? "nd" : ...etc

Is there a way to make it so that “st”, “nd”, “rd” and “th” show as superscripts of the number?


Hi @alejandro.221. Apologies for the delay. Did you ever get an answer to your question?

Hello Jeffrey,

I did not.

Hi @Jack.W. Do you have a quick solution for @alejandro.221’s print template question?

The hurdle you have to get around to get superscript into print templates is that a formula in a print template must have the same formatting throughout. To get around this you pull out the section of the formula that must be superscript and make it superscript in the template. Below is a screenshot of the template and also the contents.

$formula(dateformat("d",$contract_start_date))$formula((dateformat("dd",$contract_start_date))=="11"||(dateformat("dd",$contract_start_date))=="12"||(dateformat("dd",$contract_start_date))=="13" ? "th" :  (((replace(dateformat("dd",$contract_start_date),".*(.)","$1"))=="1" ? "st" :    ((replace(dateformat("dd",$contract_start_date),".*(.)","$1"))=="2" ? "nd" :       ((replace(dateformat("dd",$contract_start_date),".*(.)","$1"))=="3" ? "rd" : "th"))))) day of $formula(dateformat("MMMM",$contract_start_date))
1 Like


Wow…! That’s such a bizarre and unlikely solution that I simply know I would have never figured it out in a thousand years of trying. Weeeiiiiird!

The most astonishing thing is that it actually works!
Thank you, that is exactly what I needed, and it’s a very helpful addition to my library of code tricks!