Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

W. Sales

[Resolvido] Ai galera como mudar o farmato de exibição da enquete

Recommended Posts

sql = "insert into ballot (ip, selection" & u_input &") "

sql = sql & "values ('" & u_ip & "',1)"

rs.Open sql, cn

end if

 

 

sql= "select distinctrow sum(selection1) as sum_selection1, "

sql= sql & "sum(selection1) AS sum_selection2, count(*) AS total_votes "

sql= sql & "FROM ballot;"

rs.Open sql, cn

total1=rs ("sum_selection1")

total2=rs ("sum_selection2")

count=rs ("total_votes")

%>

<br>

A<img src="images/red.jpg" height="10" width="<%= (total1)%>">

<%= formatnumber(total1) %><br>

B<img src="images/yellow.jpg" height="10" width="<%= (total2)%>">

<%= formatnumber(total2) %><br>

Total Votes: <%= formatnumber(count,0,0) %><br>

 

<% if been_here_before <> "No" then %>

This user has voted before and this one was <u>not</u> counted.....

<% else %>

This user has <u>not</u> voted before and this one was counted.....

<% end if %>

<br>

The I.P. Address is <%= u_ip %>

<% end if %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

onde transformou em percentual?

Compartilhar este post


Link para o post
Compartilhar em outros sites

você esta usando o FormatNumber() , para porcentagem use o FormatPercent() , o qual retorno uma expressão formatada com porcentagem (multiplicada por cem) com o caractere %.

Compartilhar este post


Link para o post
Compartilhar em outros sites

FormatNumber numeros reais mesmo, no caso seria cada resultado mostraria a quantidade de voto mesmo e não em percentagem.

 

A quenete é essa enquete acima que você me ajudou com os IPs,

to engatinhando no asp ainda.

Compartilhar este post


Link para o post
Compartilhar em outros sites

pode ser assim?

 

A<img src="images/blue.jpg" height="10" width="<%= (total1/count)*100 %>">
<%= formatnumber((total1),1)  %><br>
B<img src="images/yellow.jpg" height="10" width="<%= (total2/count)*100 %>">
<%= formatnumber((total2),1)  %><br>
Total Votes: <%= formatnumber(count,0,0) %><br>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.