# Seconds to Minuets (00.00 Format)

**URL:** <https://forum.kirupa.com/t/seconds-to-minuets-00-00-format/250968>\
**Category:** flash\
**Created:** [February 4, 2008, 4:44am UTC](https://forum.kirupa.com/t/seconds-to-minuets-00-00-format/250968 "2008-02-04T04:44:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nineteen](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nineteen/32/2679_2.png) [@Nineteen](https://forum.kirupa.com/u/Nineteen)\
**Post date:** [February 4, 2008, 4:44am UTC](https://forum.kirupa.com/t/seconds-to-minuets-00-00-format/250968/1 "2008-02-04T04:44:33Z")

</div>

Hi there,

I just finished making a Seconds -\> Minutes converter that lays them out in the format of (m.ss). Eg: (5.00) is 5minutes, (0.05) is 5 seconds.

What I would like is to have it more dynamic so that if it was 15minutes it would say (15.00) and 5 minutes would be (5.00).

Below is the code I wrote, i think its kind of… Weird :D? The two numbers entered into the function are in ‘seconds’.

```auto

//Display Minutes / Seconds Duration
function generateTime(nCurrentTime:Number, nCurrentDuration:Number):Void {
    var nCurrentTimeConverted:Number = Math.round(nCurrentTime);
    var sCurrentTime:String;
    var sCurrentDuration:String = (Math.round((nCurrentDuration / 60) * 100) / 100) + "";
    //Convert to Minutes
    if (nCurrentTimeConverted >= 60) {
        nCurrentTimeConverted = Math.round((nCurrentTimeConverted / 60) * 100) / 100;
        if (nCurrentTimeConverted.toString().length == 3) {
            sCurrentTime = nCurrentTimeConverted + "0";
        } else if (nCurrentTimeConverted.toString().length == 1) {
            sCurrentTime = nCurrentTimeConverted + ".00";
        } else {
            sCurrentTime = nCurrentTimeConverted + "";
        }
    } else {
        nCurrentTimeConverted = Math.round(nCurrentTime) / 100;
        if (nCurrentTimeConverted.toString().length == 3) {
            sCurrentTime = nCurrentTimeConverted + "0";
        } else if (nCurrentTimeConverted.toString().length == 1) {
            sCurrentTime = nCurrentTimeConverted + ".00";
        } else {
            sCurrentTime = nCurrentTimeConverted + "";
        }
    }
    dTTime.text = sCurrentTime + " / " + sCurrentDuration;
}

```

Help would be much appreciated!
