1 unstable release

new 0.1.1 Feb 20, 2025

#479 in Internationalization (i18n)


Used in pg_

MulanPSL-2.0

11KB

hsec : human readable seconds

pub fn hsec(sec: u64) -> String {
  let minutes = sec / 60;
  if minutes < 99 {
    return format!("{} 分钟", minutes);
  }

  let hours = sec / 3600;
  if hours < 99 {
    return format!("{} 小时", hours);
  }

  format!("{}", sec / 86400)
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Dependencies

~135KB