There are a few formatting scripts in the UDF forum.

So were you able to accomplish what you're looking for yet or do you still need assistance?

If you need more help, maybe post the exact return value of the key that you want converted and I'm sure we can find the correct conversion for you.