code/ViewableWrapper.php
public function AsPhone($field)
    {
        $str = preg_replace('/[^0-9]/', '', $this->$field);
        $out = '';

        switch (strlen($str)) {
            case 11:
            case 12:
                $str = ltrim($str, '0');
                $out .= '+' . substr($str, 0, -10) . ' ';
            case 10:
                $out .= '(' . substr($str, -10, 3) . ') ';
            case 7:
                $out .= substr($str, -7, 3) . '-' . substr($str, -4);
            break;

            default:
                $out = $str;
        }

        return $out;
    }
public function AsPhone($field)
    {
        $str = preg_replace('/[^0-9]/', '', $this->$field);
        $out = '';

        switch (strlen($str)) {
            case 11:
            case 12:
                $str = ltrim($str, '0');
                $out .= '+' . substr($str, 0, -10) . ' ';
            case 10:
                $out .= '(' . substr($str, -10, 3) . ') ';
            case 7:
                $out .= substr($str, -7, 3) . '-' . substr($str, -4);
            break;

            default:
                $out = $str;
        }

        return $out;
    }
returns the given field as a uniformly formatted phone #
!todo - does this need to work differently for internationals?