consul/ui/packages/consul-ui/app/helpers/duration-from.mdx
John Cowen 18e1267220
ui: Adds human formatting to nanosecond based session durations (#10062) (#10141)
* ui: Adds human formatting to nanosecond based session durations
2021-05-04 14:01:41 +01: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.