Sorry for that bad example, of course there is a format helper. It is rather a general question whether custom functions can be entered within an hbs template.
After some research I also found a format helper to achieve leading zero in german postage code.
{{number OLC70Postcode "00000"}}
In the first place I tried to create a custom function to use padStart().
But it is not possible to use custom helpers in the Address Block hbs template?
In the above case it would be fine to check if the country is empty or ‘deutschland’ or ‘germany’ or ‘de’. Only if one of these cases is true I want to pad. The easiest way to do this would of course be to use a custom JavaScript function.
PS: I love that Address Block feature and want to use it for different use cases beyond an address.
I’m afraid you need a control script. It’s currently not possible to register a custom helper from within a Handlebars partial or address block template.