Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting a Integer in HTML Form

Status
Not open for further replies.

steveirwin

Programmer
May 30, 2000
2
US
How do you format an integer like 10000 from a sql db into a readable format like 100.00 or $100.00.&nbsp;&nbsp;I am retreiving the info from a select string. The asp page i am using the code &lt;%=rst(&quot;ProgramAmount&quot;)%&gt; and the value displayes as 10000&nbsp;&nbsp;&nbsp;I want to display 100.00 or $100.00.<br>Thank in advance. any ideas?
 
Use the following:<br>&nbsp;&nbsp;&lt;%=format(rst(&quot;ProgramAmount&quot;, &quot;####.00&quot;)%&gt;<br><br>You may need to adjust the format mask to get a suitable result.<br><br>If it's definitely currency there's a FormatCurrency which is probably more useful.<br><br>&nbsp;&nbsp;&lt;%=formatcurrency(rst(&quot;ProgramAmount&quot;)%&gt;<br><br>If ProgramAmount = 1000, this line will return $1,000.00<br>By default, it uses the Computers Region settings. <p>Ben Marshalsea<br><a href=mailto: > </a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top