E
E
egorlisss2019-03-26 11:32:19
JavaScript
egorlisss, 2019-03-26 11:32:19

How to convert minutes to hours?

vk.updates.hear(/^(?:СП Топ-30)$/i, async (context) => { 
    axios.get(`https://minecraft-statistic.net/api/server/top/145.239.133.118_25565/all/1`).then(res => {
    return res.data;
    }).then(data => {
    let message = ''; 
        data.data.forEach(item => {
    data.data.sort((a, b) => b.time - a.time);
    message += item.nickname + ' - ' + item.time + ' минут\n';
    })
  return context.send(`⭐ Топ-30 онлайна СП:\n\n${message}`);
  })
});

Need item.time to be in hours, not minutes

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2019-03-26
@egorlisss

Divide by 60 and do whatever you want with the remainder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question