The best place to fix this is at the source - whether that is your directory or whatever is feeding it. Fixups like this are a potential source of grief later on, e.g. when someone decides to fix the format in the directory a few months down the track.
However, if you really have no alternative, you could:
- create an Activity Association for the cost_center field
- create an Activity Notification for the cost_center update
- create a site-defined condition that tests if the cost_center isn't already in the correct format - to prevent a loop
- write a macro to reformat the field
- create an event against the notification, which if the site-defined condition returns true (i.e. it's not correctly formatted) calls the macro to reformat the cost_center field.
You could also do this with a trigger, but that is a less 'visible' solution so would not be my first choice.
Hopefully you'll decide that getting the field reformatted at source is a lot less trouble :-).
Regards,
James