Here you can find the source of formatMinutes(int minutes)
Parameter | Description |
---|---|
minutes | a parameter |
public static String formatMinutes(int minutes)
//package com.java2s; //License from project: GNU General Public License public class Main { /**/*www.java2 s. co m*/ * Converts minutes to hours and minutes separated by colon, i.e. H:MM * * @param minutes * @return hours and minutes separated by colon, i.e. H:MM */ public static String formatMinutes(int minutes) { int hours = minutes / 60; int minuteRemainder = minutes % 60; return String.format("%d:%02d", hours, minuteRemainder); } }