mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
26 lines
499 B
PowerShell
26 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;
|
|
}
|