formating bounding box dim

I would like to use the bounding box dim in expression to use those value in a kind of verification process to validate the material. The only thing is that if the option is set to decimal, the bounding box dim will be always in decimal but I need it to bet displayed in fraction sometimes. Is there a way to do it? I add the bounding box address in expression inside the properties, so I though I could use a format() function or something, but looks not and I have no way to assign a style to those dim (no way to select them)...

Thanks