Summary: Use the [decimal] Windows PowerShell type accelerator to round decimal numbers.
How can I use Windows PowerShell to easily round a decimal number an integer?
Use the Round method from the [decimal] type accelerator:
PS C:\> [decimal]::round(10.555)
11
PS C:\> [decimal]::round(10.444)
10
0 comments