Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Seguinte gente to com problema e ja to ficando doido quando vou puxar valores como 456,25 que está no banco de dados a pagina me mostra 45,625.00 eu realmente quero 2 casas decimais mais o numero esta andando duas casa a frente da virgula.
O código é o seguinte
<%Response.Charset="ISO-8859-1"%>
<%
Set cnn = Server.CreateObject( "adodb.Connection" )
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath("Dados.mdb") &";"
Set rsDADOS = Server.CreateObject("ADODB.RecordSet")
tabela = "form"
sql = "SELECT * from " & tabela
SET rstemp = Server.CreateObject("Adodb.recordset")
rstemp.CursorLocation=3
rstemp.Open SQL, cnn
total = rstemp.recordcount
campos=rstemp.fields.count -1
if not rstemp.eof Then
x=0
response.write "<center>Total de registros " & total & "<br>"
response.write "<table border='0' width=50% align=center><tr bgcolor=#c3c3c3>"
FOR i=0 to campos
response.write "<TH>" & rstemp(i).name & "</th>"
NEXT
DO UNTIL rstemp.eof
if (x mod 2 = 0) then
response.write "<tr bgcolor =#F0F0F0>"
else
response.write "<tr bgcolor =#FFFFFF>"
end if
FOR i = 0 to campos
fieldvalue=rstemp(i)
If trim(fieldvalue)="" THEN
fieldvalue=" "
else
If IsNumeric(fieldvalue) Then
response.write "<td align=right>" & FormatNumber(fieldvalue,2)
else
response.write "<td align=left>" & fieldvalue
End if
end if
response.write "</td>"
next
response.write "</tr>"
x=x+1
rstemp.movenext
LOOP
response.write "</table></center>"
Else
response.write "Tabela sem dados"
End if
rstemp.close
cnn.close
Set cnn=nothing
%>Por favor quem puder me ajude.
Carregando comentários...