Formatting the Numbers in PowerShell


Pretty good article about the formatting the number is PowerShell can be found here (http://technet.microsoft.com/en-us/library/ee692795.aspx). Some useful examples for $A = 348 are below:

Command Output Type
“{0:N2}” -f $A 348.00 Numeric
“{0:D8}” -f $A 00000348 Decimal
“{0:C2}” -f $A $348.00 Currency
“{0:P0}” -f $A 34,800 % Percent
“{0:X0}” -f $A 15C Hexdecimal
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: