mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
27 lines
499 B
PowerShell
27 lines
499 B
PowerShell
|
|
function Test-IcingaDecimal()
|
||
|
|
{
|
||
|
|
param (
|
||
|
|
$Value = $null
|
||
|
|
);
|
||
|
|
|
||
|
|
[hashtable]$RetValue = @{
|
||
|
|
'Value' = $Value;
|
||
|
|
'Decimal' = $FALSE;
|
||
|
|
};
|
||
|
|
|
||
|
|
if ($null -eq $Value -Or [string]::IsNullOrEmpty($Value)) {
|
||
|
|
return $RetValue;
|
||
|
|
}
|
||
|
|
|
||
|
|
$TmpValue = ([string]$Value).Replace(',', '.');
|
||
|
|
|
||
|
|
if ((Test-Numeric $TmpValue) -eq $FALSE) {
|
||
|
|
return $RetValue;
|
||
|
|
}
|
||
|
|
|
||
|
|
$RetValue.Value = [decimal]$TmpValue;
|
||
|
|
$RetValue.Decimal = $TRUE;
|
||
|
|
|
||
|
|
return $RetValue;
|
||
|
|
}
|