A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Java in General
Author
need int value instaed of decimal values
fioana elegant
Greenhorn
Joined: Oct 06, 2010
Posts: 16
posted
Oct 11, 2010 10:28:15
0
public class
test
{
public static void main(
String
[] args)
{
float minutes=92.2f;
double hour=Math.floor(minutes/60);
double min=Math.floor(minutes%60);
String time2=hour+":"+ min;
System.out.println("######################"+hour);
System.out.println("######################----"+min);
System.out.println("######################---------"+time2);
}
}
output is 1.0
32.2
but i need 1:32 as final output
can someone help???
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
I like...
posted
Oct 11, 2010 10:35:58
0
Please
UseOneThreadPerQuestion
. Please continue
here
.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I agree. Here's the link:
http://aspose.com/file-tools
subject: need int value instaed of decimal values
Similar Threads
Applet timer
how to compute time?
how to set time in hh:mm:ss Format?
need to get integer value instead of float value
Troubles with output
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter