int To Second - Android java.util

Android examples for java.util:Second

Description

int To Second

Demo Code


//package com.java2s;
import android.text.TextUtils;

public class Main {
    public static String intToSec(long timing) {
        String finalString = "";
        if (timing - 1000 > 0) {
            //We have been running for more than a second. Calculate seconds:
            int seconds = (int) Math.floor(timing / 1000);
            finalString += Integer.toString(seconds) + " Sec ";
        } else if (!TextUtils.isEmpty(finalString)) {
            finalString += "0 Sec ";
        }/* w  ww  .  j a  v  a2s .  c o m*/
        return finalString;
    }
}

Related Tutorials