Sunday, June 14, 2015

Format Numbering Currency ASP VB and ASP.NET C#

Use this syntax to convert decimal or integer into currency format:

7219208.120 --> 7,219,208.12

For ASP classic:


formatnumber(YourValue, 2)

Example:
<td <%=bg%> align=right><%=FormatNumber(Rst("AMOUNT"),2)%></td>


For ASP.NET C#:

String.Format("{0:n}",YourValue)

Example:

<td align=right><%=String.Format("{0:n}",YourValue)%></td>



Best Wishes,

LadyinProgramming

No comments:

Post a Comment