icinga-powershell-framework/lib/core/tools/ConvertFrom-Percent.psm1

15 lines
280 B
PowerShell
Raw Normal View History

2021-05-07 08:38:10 -04:00
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));
}