开发者

C# code to format amount value

Here I have data in a dataset like below

Em开发者_C百科pID   Amount

100      890
200      4567.78
300      4578

Now I want C# code to format Amount column values like below

EmpID    Amount

100      0890.00
200      4567.78
300      4578.00

Thanks

Anuradha.J


int amount = ????; // vale of the amount column
String.Format("{0:0000.00}", amount);


ok: this is it:

ToString("000000.00")


You can use .ToString(format) (if is a decimal or something like this).

More information here: http://msdn.microsoft.com/en-us/library/fzeeb5cd.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜