Web component: Tangular-Counter


  • Info
  • HTML
  • JS
  • CSS
  • Meta

Tangular-Counter

This helper can create a short value from big numbers.

Thelpers.counter([value], [decimals]);
// @value {Number} a value
// @decimals {Number} optional, count of decimals (default: `0`)

Outputs:

  • 10 K
  • 1 024
  • 1 M

Usage:

<h1>{{ name }}</h1>
<div>{{ userscount | counter }}</div>

or

console.log(Thelpers.counter(134000));
Browser‘s Save action performs Preview