A little background first.

Like a lot of people I commute to work using the Train and by using the solution here. I can obtain the expected time the trains will depart from my location station. In addition the rule provides the time until the train is due to depart as a whole number; ie 22.

By using this rule I’m able to get an estimated time it will take me to drive to the station. The time however is in seconds. So makes it a little difficult to calculate which is the earliest train i can get. I thought I’d found a solution by using a small JS to map the value from seconds to minutes.

```
(function(i) {
if (i == 'NULL') { return i; }
if (i == '-') { return 'Undefined'; }
minutes = Math.floor(i / 60);
return minutes;
})(input)
```

Although this works it doesn’t provide me with a whole number, I get a decimal value return; ie 19.0.

As my knowledge is limited I’m looking for some help. Open to any alternatives or suggestions.

Thanks,

Garry