[Bio] / FigKernelPackages / Tracer.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Tracer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.54, Sun Jun 18 07:40:23 2006 UTC revision 1.55, Sun Jun 18 09:55:24 2006 UTC
# Line 2048  Line 2048 
2048      }      }
2049  }  }
2050    
2051    =head3 CommaFormat
2052    
2053    C<< my $formatted = Tracer::CommaFormat($number); >>
2054    
2055    Insert commas into a number.
2056    
2057    =over 4
2058    
2059    =item number
2060    
2061    A sequence of digits.
2062    
2063    =item RETURN
2064    
2065    Returns the same digits with commas strategically inserted.
2066    
2067    =back
2068    
2069    =cut
2070    
2071    sub CommaFormat {
2072        # Get the parameters.
2073        my ($number) = @_;
2074        # Pad the length up to a multiple of three.
2075        my $padded = "$number";
2076        $padded = " " . $padded while length($padded) % 3 != 0;
2077        # This is a fancy PERL trick. The parentheses in the SPLIT pattern
2078        # cause the delimiters to be included in the output stream. The
2079        # GREP removes the empty strings in between the delimiters.
2080        my $retVal = join(",", grep { $_ ne '' } split(/(...)/, $padded));
2081        # Clean out the spaces.
2082        $retVal =~ s/ //g;
2083        # Return the result.
2084        return $retVal;
2085    }
2086  =head3 SetPermissions  =head3 SetPermissions
2087    
2088  C<< Tracer::SetPermissions($dirName, $group, $mask, %otherMasks); >>  C<< Tracer::SetPermissions($dirName, $group, $mask, %otherMasks); >>

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3