The following code prints It's greater than 1:
$value = "1.9964672441318374e-005"
If ($value -ge 1)
{
Write-Host "It's greater than 1"
}
Else
{
Write-Host "Smaller than 1"
}
I understand that this can be corrected by casting $value to a [double]. I was wondering if anyone else encountered this inconsistent behavior. I say inconsistent because for decimal formatted strings the comparison yields the correct output. Any thoughts?