Actually the format of the page.number is defined by
the element, including passing a parameter so strange
I think the thing really defines the format is the
page-master , not the element. I send a patch with the
changes made to accomplish that.
I have maintained the $element parameter and have
included a $master-reference one.
I hope that will help you. I have used it in my
customization of templates.