Use PowerShell to round numbers

This one is easy. Normally, a division operation would yield a floating number in PowerShell:

PS Data [07/04/2017 19:48:41]> 15/9

To round numbers, you can use the round() method from System.Math Class. Here’s an example:

PS Data [07/05/2017 10:32:05]> [Math]::Round(15/9)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s