Any way to add ordinal suffix to day values?

I want to be able to add the ordinal suffixes for day of month values in templates, but since I don’t have an actual date, how do I do that? For example:
Your Invoice will be sent on the 1st of the month, and payment is due on the 15th of the month. Can you create custom functions?

Need this kind of logic:
https://www.if-not-true-then-false.com/2010/php-1st-2nd-3rd-4th-5th-6th-php-add-ordinal-number-suffix/

Hello,

can you please make a screenshot of some invoice, hide private data and show us on that screenshot what you mean?

It’s more for the welcome emails and reminder emails. I need to add the appropriate suffix on all day of month numbers or else it’s not proper English.

“Your bill is due on the 1 day of month”
“Your bill is due on day 1 of the month”
Are both incorrect, I need:
“Your bill is due on the 1st of the month”

In php you can get that with a date formatter, but these aren’t date values, they are just numbers, so it would need a custom function, like the one at that link. Is there a way to add custom functions? Or could there be?

something like this

{% set testing_day = 15%}
{% set testing = testing_day~"now"|date(".m.Y")%}

Testing on {{testing_day}}{{ testing|date("S") }}

https://twig.symfony.com/doc/2.x/filters/date.html
https://www.php.net/manual/en/function.date.php

I think that will work and will try it out as soon as I can, thanks.

In personal home page you could get that with a date formatter, but these aren’t date values, they’re simply numbers, so it might want a custom function, and using the temporary mail from https://owlymail.com/blog/, you will get the access just like the one at that hyperlink. Is there a way to feature custom capabilities? Or could there be?