Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/**
 * Title:        efa - elektronisches Fahrtenbuch fr Ruderer
 * Copyright:    Copyright (c) 2001-2011 by Nicolas Michael
 * Website:      http://efa.nmichael.de/
 * License:      GNU General Public License v2
 *
 * @author Nicolas Michael
 * @version 2
 */

public class Main {
    public static String getHHMMstring(long minutes) {
        long hh = minutes / 60;
        long mm = minutes % 60;
        return hh + ":" + long2String(mm, 2);
    }

    public static String long2String(long l, int minDigits) {
        StringBuilder s = new StringBuilder(minDigits);
        s.append(Long.toString(l));
        while (s.length() < minDigits) {
            s.insert(0, "0");
        }
        return s.toString();
    }
}