Here you can find the source of secondsToReadableBiggest(int seconds)
Parameter | Description |
---|---|
seconds | the seconds to transform |
public static String secondsToReadableBiggest(int seconds)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w .j av a2 s.c om*/ * Changes the amount of seconds to its biggest part<br/> * More then an hour returns "xx hour"<br/> * Less then an hour but more then a minute returns "xx min"<br/> * Otherwise returns "xx sec" * @param seconds the seconds to transform * @return the readable string */ public static String secondsToReadableBiggest(int seconds) { if (seconds > 60 * 60) return Math.round(seconds / (60 * 60)) + " hour"; else if (seconds > 60) return Math.round(seconds / 60) + " min"; else return seconds + " sec"; } }