Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

prob in float...

843854Mar 10 2005 — edited Mar 10 2005
this is my insertion query in the database, my problem is that when i insert decimal values like 15464545454.32, it displays like 1.54645E7..plz do something...i want to display as the same decimal values as i eneterd....
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO GL_MAST VALUES (?, ?, ?, ?, ?, ?)");

---
---
float Dr_Amt =Float.parseFloat(request.getParameter("DrAmount" ));
pstmt.setFloat(3,Dr_Amt );

float Cr_Amt =Float.parseFloat(request.getParameter("CrAmount" ));
pstmt.setFloat(4,Cr_Amt);
----
----
sql = conn.prepareStatement("SELECT * FROM GL_MAST ");
results = sql.executeQuery();

while(results.next())
{

db_amt = results.getFloat("db_amt");
cr_amt = results.getFloat("cr_amt");

out.println("<td><INPUT TYPE='TEXT' NAME='db_amt' size='12' value='" + db_amt + "' readonly </td>");
out.println("<td><INPUT TYPE='TEXT' NAME='db_amt' size='12' value='" + cr_amt + "' readonly </td>");
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2005
Added on Mar 10 2005
1 comment
94 views