Showing results for math - 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 example: PS ...

Scripting Guy!Windows PowerShellPowerTip
Apr 14, 2016
0
0

Calculate percentage character frequencies from a text file by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to calculate the percentage of how often a character appears in a text file. This is the fifth post in a multi-part series of blog posts that deal with how to determine letter frequency in text files. To fully understand this post, you should read the entire series in order. Here are the posts in the s...

Scripting Guy!Windows PowerShellFormatting output
Jan 29, 2016
0
0

PowerTip: Return remainder after dividing two numbers

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to return the remainder after dividing two numbers.  How can use Windows PowerShell to divide two numbers and only return the remainder (called a modulo operation)?  In Windows PowerShell, the modulo operator is the % sign. Here are a few examples of how to use it: PS C:\> 3 % 2 ...

Scripting Guy!Windows PowerShellPowerTip
Mar 14, 2015
0
0

Weekend Scripter: Approximate the Value of Pi from a Polygon

Doctor Scripto
Doctor Scripto

Summary: Microsoft senior software engineer, Firaz Samet, shows how to use Windows PowerShell to approximate the value of pi from a polygon. Microsoft Scripting Guy, Ed Wilson, is here. Today we have a guest blog post from Firaz Samet in honor of Pi (π) Day. I will turn the blog over… The Scripting Guy ran across my PowerShell Math Module...

Scripting Guy!Windows PowerShellscripting techniques
Nov 10, 2013
0
0

Weekend Scripter: PowerShell Does Scientific Notation

Doctor Scripto
Doctor Scripto

Summary: Microsoft PFE and guest blogger, Clint Huffman, talks about scientific notation and Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Today we have another guest blogger from the past—Clint Huffman. The keyboard is yours Clint… In Performance Monitor, if a number in a field is too large to display, scientific no...

Scripting Guy!Windows PowerShellscripting techniques