diff options
author | ivan <ivan> | 2004-12-23 07:29:36 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-12-23 07:29:36 +0000 |
commit | 902e98b8b1dd2fd4ba76e5f8b3d1d20796d65a69 (patch) | |
tree | 4fa488984622e2ea5ea9014b4af70613bcbdf306 /FS/FS/rate_region.pm | |
parent | 584caeef2ac90ab10fc028a7928b9ebc53e8b33a (diff) |
better short prefix display
Diffstat (limited to 'FS/FS/rate_region.pm')
-rw-r--r-- | FS/FS/rate_region.pm | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/FS/FS/rate_region.pm b/FS/FS/rate_region.pm index 7945f52..65dfd2a 100644 --- a/FS/FS/rate_region.pm +++ b/FS/FS/rate_region.pm @@ -281,13 +281,20 @@ sub prefixes_short { foreach my $rate_prefix ( $self->rate_prefix ) { if ( $countrycode ne $rate_prefix->countrycode ) { - $out =~ s/,$//; + $out =~ s/, $//; $countrycode = $rate_prefix->countrycode; - $out.= " $countrycode-"; + $out.= " +$countrycode "; } - $out .= $rate_prefix->npa. ','; + my $npa = $rate_prefix->npa; + if ( $countrycode eq '1' ) { + $out .= '('. substr( $npa, 0, 3 ). ')'; + $out .= ' '. substr( $npa, 3 ) if length($npa) > 3; + } else { + $out .= $rate_prefix->npa; + } + $out .= ', '; } - $out =~ s/,$//; + $out =~ s/, $//; $out; } |