mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-12 13:49:22 -05:00
* YouTube lite embed + CSS bundled import * Migration initial * New VoD page initial functioning * Table changes + add TODOs * New structure for add vod page * WIP add new VoD backend * Merge branch 'rewrite' of https://github.com/Sendouc/sendou.ink into vods * Fix when leaderboard appears * Function new vod form * Single vod page initial * Different YouTubeEmbed * Scroll to top when going to timestamp * Vod match weapon/mode icons * Vod page user * Add date to vod page * Adjust migration order * Vod page many weapons * Add title to vod page * New vods page cast many weapons * Add player index to order by * Vods new more validation * Vod listing page initial * Vods page with filters * Show message if no vods * Fix not being to unset filters * Fix seed sometimes throwing errors * User page VoDs * Vods nullable weapon combobox * Link directly to user custom url from vod page * Make video adder admin action * Can add video checks * i18n * New VoD form tests * VoD operates filters test * Vods behind flag * Remove from config
10 lines
322 B
TypeScript
10 lines
322 B
TypeScript
export function roundToNDecimalPlaces(num: number, n = 2) {
|
|
return Number((Math.round(num * 100) / 100).toFixed(n));
|
|
}
|
|
|
|
export function secondsToMinutes(seconds: number) {
|
|
const minutes = Math.floor(seconds / 60);
|
|
const secondsLeft = seconds % 60;
|
|
return `${minutes}:${secondsLeft.toString().padStart(2, "0")}`;
|
|
}
|