Get-GrowthRate (modification of post by view diff)
View followups from jturnage and Damien Ryan | embed code: <script type="text/javascript" src="http://PoshCode.org/embed/699"></script>download | new post
Calculates percentage growth rate given a starting value, ending value, and number of periods in the range. @stahler thx!
- function Get-GrowthRate {
- param( $Start, $End, $Period )
- $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $per - 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