Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Displaying an interger in float

This is a discussion on Displaying an interger in float within the Java forums, part of the Software Development category; In oracle,a fieldname has been declared in int. But i have to display it in float. Please help me to find a solution....

Go Back   Geeks Talk > Software Development > Java
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Java Java related Issues and Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-03-2007
Junior Member
 
Join Date: Aug 2007
Posts: 22
Thanks: 4
Thanked 0 Times in 0 Posts
3roses is on a distinguished road
Displaying an interger in float

In oracle,a fieldname has been declared in int. But i have to display it in float. Please help me to find a solution.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-03-2007
Banned
 
Join Date: Nov 2005
Posts: 45
Thanks: 1
Thanked 7 Times in 6 Posts
ejazazeem79 is on a distinguished road
Re: Displaying an interger in float

you can assign the int to float and then display.

but it will display xxxx.0 becuase you have already lost the precision information.
e.g.

int abc = 12345;
float abf = abc;
System.out.println(abf);

will display ...
12345.0

hope this will help.
by the way, how you have exactly defined the filed in Oracle?

Regards.
Reply With Quote
The Following User Says Thank You to ejazazeem79 For This Useful Post:
  #3 (permalink)  
Old 09-10-2007
Junior Member
 
Join Date: Sep 2006
Location: Pune, India
Posts: 10
Thanks: 1
Thanked 1 Time in 1 Post
lhariPrasad is on a distinguished road
Re: Displaying an interger in float

Use the format command ... as it is a simple display ... is that ok ?
Reply With Quote
Reply

  Geeks Talk > Software Development > Java

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Can we add integer, float objects while using collections Geek_Guest Java 2 08-27-2007 04:16 AM
Displaying data in a DataGrid for particular column JobHelper ASP.NET 1 02-26-2007 10:58 PM


All times are GMT -4. The time now is 12:41 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved