reusable formatting for units