public static function showProgressBar($percentage, int $numDecimalPlaces)
    {
        $percentageStringLength = 4;
        if ($numDecimalPlaces > 0)
        {
            $percentageStringLength += ($numDecimalPlaces + 1);
        }
        
        $percentageString = number_format($percentage, $numDecimalPlaces) . '%';
        $percentageString = str_pad($percentageString, $percentageStringLength, " ", STR_PAD_LEFT);
        
        $percentageStringLength += 3; // add 2 for () and a space before bar starts.
        
        $terminalWidth = `tput cols`;
        $barWidth = $terminalWidth - ($percentageStringLength) - 2; // subtract 2 for [] around bar
        $numBars = round(($percentage) / 100 * ($barWidth));
        $numEmptyBars = $barWidth - $numBars;
        
        $barsString = '[' . str_repeat("=", ($numBars)) . str_repeat(" ", ($numEmptyBars)) . ']';
        
        echo "($percentageString) " . $barsString . "\r";
    }