Not Solved How can I get this types of view format???
Not Solved
Help needed Bosses in the house

How can I made my showthread view to be in this format e.g 31k 

Instead of that long 31573 

How can I get the format to make the view be in 31k, when it reach million it should be 31M etc

How can I get that please

Check below image for what am saying, I wanna get rid of that view format

Attached Files Thumbnail(s)
Not Solved
There is no simple option.
It is necessary to modify PHP code adding new procedures to calculate number in thousands/millions.

MyBB Forum + innovative full-responsive Theme
Not Solved
How can I achieve that, can you help me on that
Not Solved
This script will abbreviate/shorten the number when applied to the views on your showthread template.

function abbreviate(number, maxPlaces, forcePlaces, forceLetter) {
  number = Number(number)
  forceLetter = forceLetter || false
  if(forceLetter !== false) {
    return annotate(number, maxPlaces, forcePlaces, forceLetter)
  var abbr
  if(number >= 1e12) {
    abbr = 'T'
  else if(number >= 1e9) {
    abbr = 'B'
  else if(number >= 1e6) {
    abbr = 'M'
  else if(number >= 1e3) {
    abbr = 'K'
  else {
    abbr = ''
  return annotate(number, maxPlaces, forcePlaces, abbr)

function annotate(number, maxPlaces, forcePlaces, abbr) {
  // set places to false to not round
  var rounded = 0
  switch(abbr) {
    case 'T':
      rounded = number / 1e12
    case 'B':
      rounded = number / 1e9
    case 'M':
      rounded = number / 1e6
    case 'K':
      rounded = number / 1e3
    case '':
      rounded = number
  if(maxPlaces !== false) {
    var test = new RegExp('\\.\\d{' + (maxPlaces + 1) + ',}$')
    if(test.test(('' + rounded))) {
      rounded = rounded.toFixed(maxPlaces)
  if(forcePlaces !== false) {
    rounded = Number(rounded).toFixed(forcePlaces)
  return rounded + abbr
Name's Waleed, I'm a graphic and web design (2015) graduate from Canada. Self-employed and lending my design skills to the MyBB community.
Not Solved
Cool it work
Not Solved
Normal: there is no call of the abbreviate function. And using JS to modify this kind of stats seems strange for me.
imho, the best might be to create a plugin which will replace the numerical value with the abbreviated one.
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord

Forum Jump:

Users browsing this thread: 1 Guest(s)