Use in views:

- Create view
- Add a integer field
- Change the formatter

Use in twig:

{{ field_activity_user|thousandtok }}

Here are some examples:

1000 => 1k
5821 => 5.8k
10500 => 10k
101800 => 101k
2000000 => 2m
7800000 => 7.8m
92150000 => 92m
123200000 => 123m
9999999 => 9.9m
2600000000 => 2.6b
1135060000000 => 1.1t

Refered from module:

short_scale_formatter

Supporting organizations: 

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • Created by phthlaap on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    There are currently no supported stable releases.

Releases