Forums

ASP

This topic is locked

How do you get rid of decimal places

Posted 29 Jul 2002 06:20:19
1
has voted
29 Jul 2002 06:20:19 Jeff Montgomery posted:
I have the following code:

<%@ Language=VBScript %>
<%
Option Explicit
dim x, y, z, value
x = Request.form("x"
y = Request.form("y"
z = Request.form("z"
value = x * y * z
%>
<HTML>
<HEAD>
<TITLE>Currency Converter</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<p> You entered .<br>
The converted amount is . </p>
<form name="form1" method="post" action="">
<input type="text" name="textfield" value="<%=value%>">
</form>
<p> </p>
</BODY>
</HTML>

It give me a number in the text box of 22.22334334 I need it to be just 22
how do I do this?

Thanks for your help

Replies

Replied 29 Jul 2002 09:30:15
29 Jul 2002 09:30:15 Viktor Farcic replied:
Change this line:
<pre id=code><font face=courier size=2 id=code>&lt;input type="text" name="textfield" value="&lt;%=CInt(value)%&gt;"&gt;</font id=code></pre id=code>

The difference is in CInt.


Viktor Farcic
www.farcic.com
TalkZone Manager

Reply to this topic