Showing results for Numbers - Scripting Blog [archived]

Apr 17, 2016
0
1

PowerTip: Use PowerShell to display a percentage that has two decimal places

Doctor Scripto Doctor Scripto

Summary: Use Windows PowerShell to display a percentage as a two place number.  How can I use Windows PowerShell to display a number as a percentage that has two decimal places?  Use the -f format specifier, and specify a pattern as “{0:p2}”. On the other side of the -f format specifier, perform your percentage calculation. Here is an ...

Scripting Guy!Windows PowerShellPowerTip
Jul 4, 2015
0
0

PowerTip: Multiply Value in Variable and Store Results

Doctor Scripto Doctor Scripto

Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results. How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable? Use the *= operator, for example:PS C:> $a = 2PS C:> $a *= 3PS C:> $a6...

Scripting Guy!Windows PowerShellPowerTip
Jun 28, 2015
0
0

PowerTip: Select Two Random Numbers from 20 Possibilities

Doctor Scripto Doctor Scripto

Summary: Use Windows PowerShell to select two random numbers from twenty possible numbers.  How can I use Windows PowerShell to select two of twenty attendees at user group to receive prizes?  Create a range of input numbers with the Get-Random cmdlet, then use the –Count parameter to retrieve     ...

Scripting Guy!Windows PowerShellscripting techniques
Jun 28, 2015
0
0

Weekend Scripter: Fun with Number Ranges and PowerShell

Doctor Scripto Doctor Scripto

Summary: Use Windows PowerShell to split arrays of numbers into contiguous ranges. Microsoft Scripting Guy, Ed Wilson, is here. Today I have a cool post from guest blogger, Zachary Loeber. Here is a little bit about Zachary: Zachary Loeber is a solution architect with PSC Group. Zachary is a seasoned network and systems architect and an ...

Scripting Guy!Windows PowerShellguest blogger
Jan 30, 2015
0
0

PowerTip: Use PowerShell to Round to Specific Decimal Place

Doctor Scripto Doctor Scripto

Summary: Use Windows PowerShell to round numbers to a specific decimal place.  How can I use Windows PowerShell to round a number to a specific number of decimal places, and            continue to have a number instead of converting it to a string.  Use the Round static method from the System.Math class. By ...

Scripting Guy!Windows PowerShellPowerTip

Feedback