Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Round a Decimal Number

$
0
0

Summary: Use the [decimal] Windows PowerShell type accelerator to round decimal numbers.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily round a decimal number an integer?

Hey, Scripting Guy! Answer Use the Round method from the [decimal] type accelerator:

PS C:\> [decimal]::round(10.555)

11

PS C:\> [decimal]::round(10.444)

10


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>