Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static String getMinutesString(float value) {
        int hour = (int) (value / 60);
        int minutes = (int) Math.ceil(value - (hour * 60));
        return addAZeroIfNeeds(minutes == 60 ? 0 : minutes);
    }

    private static String addAZeroIfNeeds(int value) {
        return value > 9 ? value + "" : "0" + value;
    }
}