Mar 14, 2013

.net formatting double as percentage

Double value has to be represented as percentage value.

Double amount = 0.02;
string amountPercentage = amount.ToString("#,##0.0000 %");

Observe that % is command not sign.

No comments:

Post a Comment