RSS

PS数字格式

20 Jan
先前搞cas查询的ps中,因为数字的问题搞了会,重新看了一次
http://www.microsoft.com/technet/scriptcenter/resources/pstips/jul07/pstip0720.mspx
做个小记录。
$a = 348 

"{0:N2}" -f $a
"{0:D8}" -f $a
"{0:C2}" -f $a
"{0:P0}" -f $a
"{0:X0}" -f $a

你获得的输出分别如下

348.00
00000348
$348.00
34,800 %
15C
 

Advertisements
 
Leave a comment

Posted by on January 20, 2009 in Powershell

 

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: