consul/ui/packages/consul-ui/app/helpers/duration-from.mdx
John Cowen fed8b59b00 ui: Adds human formatting to nanosecond based session durations (#10062)
* ui: Adds human formatting to nanosecond based session durations
2021-04-28 11:14:09 +00:00

14 lines
376 B
Plaintext

# duration-from
`{{duration-from nanoseconds}}` is used to format a number in nanoseconds to a
short golang-like human format, for example:
```hbs preview-template
<p>{{duration-from 15000000000}}</p>
<p>{{duration-from 15000010001}}</p>
```
**Note:** The helper only accepts a javascript number primitive currently
Also see the `temporal` service for the implementation.