How to format a custom field
hook_field_formatter_info() hook lets Drupal know about the new display denfinition and field settings, you will see your display type under Manage display settings of your content type. However the actual format of the field is returned with help of hook_field_formatter_view.

Example Code