Get-GrowthRate (modification of post by halr9000 view diff)
diff | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/704"></script>download | new post
Calculates percentage growth rate given a starting value, ending value, and number of periods in the range. stahler thx!
Corrected period variable name - djryan
- function Get-GrowthRate {
- param( $Start, $End, $Period )
- $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $Period - 1 ) ) - 1 )
- "{0:P}" -f $rate
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository