aspose file tools
The moose likes Java in General and the fly likes need int value instaed of decimal values Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

need int value instaed of decimal values

fioana elegant
Greenhorn

Joined: Oct 06, 2010
Posts: 16

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

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