Reputation: 615
I have a variable:
$a =37,5 (System.Object[]).
how i can convert it to int32 without fractional part (ex. Round to 38)? Thanks.
Upvotes: 1
Views: 7205
Reputation: 3399
$a = 37,5 #<-- THIS IS ARRAY
[int]$a_int = [math]::Round($a -join ".")
$a_int
38
$a = 37.5 #<-- THIS IS FLOAT NUMBER
[int]$a_int = [math]::Round($a)
$a_int
38
Upvotes: 3