icinga-powershell-framework/lib/core/tools/ConvertFrom-Percent.psm1
2021-05-28 20:08:23 +02:00

14 lines
280 B
PowerShell

function ConvertFrom-Percent()
{
param (
$Value = $null,
$Percent = $null,
[int]$Digits = 0
);
if ($null -eq $Value -Or $null -eq $Percent) {
return 0;
}
return ([math]::Round(($Value / 100 * $Percent), $Digits));
}