[RESOLVED] adding a line to VB/sql webpage

I am running an auction that is written in VB.. using mysql as the data base. On the detail.asp page there is a line that says Current Price and under it we have added a line that says "With Buyer's Premium" the Current Price *15%

The Current Price line shows the number formatted as $25,000.00"
The With Buyer's Premunum line show the number as 25000

when i try to use the "item.PreferredCurrency on this line it fails.

so how can i format the item.price after i have times it by 1.15

<tr class="IDPrice">
<td class="IDinfo"><%=TR("Current price")%>
<%
if item.DutchAuction = true then
Response.Write "<br /> " & TR("per item")
end if
%>
:</td>
<td>
<%=DisplayItemValue(item.price, item.PreferredCurrency)%><%
if item.reserve <> 0 then
%>
(
<%
if item.reserve <= item.price then
Response.Write TR("Reserve met")
else
Response.Write TR("Reserve not met")
end if
%>
)</td></tr>
<%
end if
%>
<tr><td colspan="2">With Buyer's Premium <%=(item.price*1.15)%></td></tr>

the code that works on the current price is in green
the code that i need to format is in red
[1565 byte] By [fclanton] at [2007-12-5 11:58:06]
# 1 Re: [RESOLVED] adding a line to VB/sql webpage
Welcome to VBForums :wave:

You aren't actually using VB, but ASP (which uses VBScript). It's not too different, but isn't quite the same.

To show the price you use this: <%=TR("Current price")%>
(The "<%=" and "%>" just say "add the value in here to the page")

So to show that multiplied by another value, simply add the multiplier, eg: <%=TR("Current price")*1.15 %>
si_the_geek at 2007-12-6 1:13:01 >
# 2 Re: [RESOLVED] adding a line to VB/sql webpage
thanks for the reply... thank god for a forum that i get one from...

i tried what you said but there is something wrong with the santex
the line fails
%
if item.DutchAuction then
Response.Write TR("Dutch Auction")
else
Response.Write TR("Auction")
end if
%>
</td>
</tr>
<tr class="IDPrice">
<td class="IDinfo"><%=TR("Current price")%>
<%
if item.DutchAuction = true then
Response.Write "<br /> " & TR("per item")
end if
%>
:</td>
<td>
<%=DisplayItemValue(item.price, item.PreferredCurrency)%><%
if item.reserve <> 0 then
%>
(
<%
if item.reserve <= item.price then
Response.Write TR("Reserve met")
else
Response.Write TR("Reserve not met")
end if
%>
)</td></tr>
<%
end if
%>
<tr><td colspan="2">With Buyer's Premium <%=TR("Current price")*1.15%></td></tr>
<%
if item.buyitnowlisting = true and item.isclosed = false then
%>
<tr>
<td> </td>
fclanton at 2007-12-6 1:14:01 >
# 3 Re: [RESOLVED] adding a line to VB/sql webpage
I haven't used ASP in a long time, so am not sure what the issue is.

Does it work if you don't use the multiplier? (eg: <%=TR("Current price")%> )

If so, try putting brackets around it, eg: <%=(TR("Current price")*1.15)%>

So that you can get help from people with more experience in this area (assuming the above doesn't solve it!), I have moved this thread to our ASP forum.
si_the_geek at 2007-12-6 1:15:03 >
# 4 Re: [RESOLVED] adding a line to VB/sql webpage
with your help i got this to work but it displays a unformatted number the line above uses the "item.PreferredCurrency". Every way i put that in it fails.

i know that ASP forum can help me better.. what is the URL

<%=DisplayItemValue(item.price, item.PreferredCurrency)%><%
if item.reserve <> 0 then
%>
(
<%
if item.reserve <= item.price then
Response.Write TR("Reserve met")
else
Response.Write TR("Reserve not met")
end if
%>
)</td></tr>
<%
end if
%>
<tr><td colspan="2">With Buyer's Premium <%=(item.price*1.15)%></td></tr>
fclanton at 2007-12-6 1:16:03 >
# 5 Re: [RESOLVED] adding a line to VB/sql webpage
I think this is what you want:
<%=DisplayItemValue(item.price*1.15, item.PreferredCurrency)%>

i know that ASP forum can help me better.. what is the URL
There is a link directly under the last post (which when you read it, will probably be this one) to the forum - or you can just pick it via the forum list on our home page ( www.vbforums.com ).
si_the_geek at 2007-12-6 1:17:02 >