There is an attribute "Uda units" where you can select the units you want the uda to use, doesn't this do what you need it to? I just created a uda which holds e.g. "1 bar".
UDA elements have the attributes UUNIT (besides the standard ones):
UUNIT defines the dimension of the attribute so that the values will be unit qualified. The
default is NONE, which means that the UDA value will be output exactly as it is stored and
will not vary according to unit settings. The UUNIT setting is only used if the UDA type is
REAL.