问题标签 [humanize]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
22 浏览

c# - MetricNumeralExtensions.ToMetric 已过时,使用 MetricNumeralFormats?

我们已将 Humanizer 从 2.8.26 升级到 2.11.10,现在收到以下警告:

有没有关于如何使用 MetricNumeralFormats 的示例?我应该用什么让它工作?

这是我们当前的代码:

在线尝试

也在 GitHub 上问过

0 投票
0 回答
53 浏览

duration - 如何转换 ISO 持续时间并使其人性化

我有一个 ISO 持续时间值,我需要显示“XX 年,XX 个月,XX 天”。我使用它luxon和humanize -duration。Duration.fromISO() 工作正常,但人性化持续时间转换出错。你能帮忙吗?

输出:

P1Y11M3D; 1年10个月28天

P2Y1M30D; 2年1个月29天