get Show Hour Minute English By Minute - Android java.util

Android examples for java.util:Minute

Description

get Show Hour Minute English By Minute

Demo Code


//package com.java2s;

public class Main {
    public static String getShowHourMinuteEnglishByMinute(long timeMinute) {
        if (timeMinute < 60) {
            return timeMinute + "minute(s)";
        }/* w  w w .j  av a 2  s  .  c  o m*/
        long hour = timeMinute / 60;
        long minute = timeMinute / 60 % 60;
        String backStr = "";
        if (hour > 0) {
            backStr = backStr + hour + "hour(s)" + minute + "minute(s)";
        }
        return backStr;
    }
}

Related Tutorials