/**
 * 将秒转化为时分秒
 * @param seconds 秒
 * @returns 时分秒
 */
export const formatSeconds = (seconds: number, gap: string = ':') => {
  const hours = Math.floor(seconds / 3600);
  const minutes = Math.floor((seconds % 3600) / 60);
  const secs = seconds % 60;
  return `${hours.toString().padStart(2, '0')}${gap}${minutes.toString().padStart(2, '0')}${gap}${secs.toString().padStart(2, '0')}`;
};

export const formatPrice = (price: number) => {
  return price / 100;
}

export const formatTime = (time: number | string, format: string = 'yyyy-mm-dd hh:MM:ss') => {
  if (!time) {
    return '';
  }
  return uni.$uv.timeFormat(time, format)
}