Round a number to the nearest 10's position
hello,
does know of trick or built-in math function round whole numbers nearest 10's position? wmi queries tend return data not want. example processor speed of 2202...i want round down 2200 or 2399...i want round 2400.
the [system.math]::round function works decimals...but need whole numbers. or @ least not using correctly whole numbers, cannot work needs.
thanks in advance
nelson
don’t forget mod!
$num = 2202
$num - ($num % 10)
the mod operator (%) shows remainder so can figure out how
much remove nearest unit
justin rich
http://jrich523.wordpress.com
powershell v3 guide (technet)
please remember mark replies answers if , unmark them if provide no help.
Windows Server > Windows PowerShell
Comments
Post a Comment