mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Merge pull request #262 from Icinga:fix/another_input_value_to_decimal_fix
Fix: Input value from check objects was sometimes not properly converted to decimal Fixes input value conversion to `decimal` for check input values.
This commit is contained in:
commit
9b5c64eacb
1 changed files with 5 additions and 0 deletions
|
|
@ -113,6 +113,11 @@ function Compare-IcingaPluginThresholds()
|
||||||
$TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $InputValue, $Unit)));
|
$TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $InputValue, $Unit)));
|
||||||
$InputValue = $TempValue.Value;
|
$InputValue = $TempValue.Value;
|
||||||
$TmpUnit = $TempValue.Unit;
|
$TmpUnit = $TempValue.Unit;
|
||||||
|
|
||||||
|
if (Test-Numeric $InputValue) {
|
||||||
|
[decimal]$InputValue = [decimal]$InputValue;
|
||||||
|
}
|
||||||
|
|
||||||
$IcingaThresholds.RawValue = $InputValue;
|
$IcingaThresholds.RawValue = $InputValue;
|
||||||
$TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $BaseValue, $Unit)));
|
$TempValue = (Convert-IcingaPluginThresholds -Threshold ([string]::Format('{0}{1}', $BaseValue, $Unit)));
|
||||||
$BaseValue = $TempValue.Value;
|
$BaseValue = $TempValue.Value;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue