Format seconds with toFixed() function to prevent errors