Title: unclebobby's Replies | WordPress.org

---

# unclebobby

  [  ](https://wordpress.org/support/users/unclebobby/)

 *   [Profile](https://wordpress.org/support/users/unclebobby/)
 *   [Topics Started](https://wordpress.org/support/users/unclebobby/topics/)
 *   [Replies Created](https://wordpress.org/support/users/unclebobby/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/unclebobby/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/unclebobby/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/unclebobby/engagements/)
 *   [Favorites](https://wordpress.org/support/users/unclebobby/favorites/)

 Search replies:

## Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] Total, Monthly and Daily all in one post](https://wordpress.org/support/topic/total-monthly-and-daily-all-in-one-post/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/total-monthly-and-daily-all-in-one-post/#post-13547913)
 * To make it clear here is a [screenshot ](https://sun9-19.userapi.com/impf/VZxreYcX0YF5U4zOsjQmD0Q0jEDhGSbxx_ruJg/figHUMpLXN8.jpg?size=745x548&quality=90&proxy=1&sign=fc9178cee5a8c0d146437634a9a57d30)
   of what I want to do
    -  This reply was modified 5 years, 7 months ago by [unclebobby](https://wordpress.org/support/users/unclebobby/).
    -  This reply was modified 5 years, 7 months ago by [unclebobby](https://wordpress.org/support/users/unclebobby/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] Total, Monthly and Daily all in one post](https://wordpress.org/support/topic/total-monthly-and-daily-all-in-one-post/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/total-monthly-and-daily-all-in-one-post/#post-13547905)
 * This displays popular posts. But I need to display the number of views in a post
   for all time, for a month and for a day
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] How to convert 1000 to 1k, 1 000 000 to 1m](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/#post-11018089)
 * Oh yeah! Yes! Thank! 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] How to convert 1000 to 1k, 1 000 000 to 1m](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/#post-11004869)
 * And again. Numbers are reduced from 33 000 to 33, But without the letter “k”.
   
   But, if I change the number 0 in the second line to 3 or more, the letter “k”
   is added. And then all the numbers and hundreds and millions will be with the
   letter “k”
 * For example code:
 *     ```
       function tptn_restyle_count( $input ) {
           $input = number_format( intval( $input ), 3, ',', '.' );
       	$input_count = substr_count( $input, ',' );
       	if ( $input_count != '0' ) {
       		if ( $input_count == '1' ) {
       			return substr( $input, 0, -4 ) . 'k';
       		} elseif ( $input_count == '2' ) {
       			return substr( $input, 0, -8 ) . 'm';
       		} elseif ( $input_count == '3' ) {
       			return substr( $input, 0, -12 ) . 'bn';
       		} else {
       			return;
       		}
       	} else {
       		return $input;
       	}
       }
       add_filter( 'tptn_post_count_only', 'tptn_restyle_count' );
       ```
   
 * Out of 541 -> number 541,0k
    33 354 -> 33,0k
 * Maybe this will help find the right solution.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] How to convert 1000 to 1k, 1 000 000 to 1m](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/#post-10989541)
 * Does not work again.
    If I use code from this link [https://gist.github.com/ajaydsouza/d0ddf2461cebab09cc38eb5ea0697cae](https://gist.github.com/ajaydsouza/d0ddf2461cebab09cc38eb5ea0697cae)
   The code does not work at all, space or comma doesn’t change anything. The numbers
   do not change.
 * If I use this code:
 *     ```
       function tptn_restyle_count( $input ) {
           $input = number_format($input);
       	$input_count = substr_count( $input, ',' );
       	if ( $input_count != '0' ) {
       		if ( $input_count == '1' ) {
       			return substr( $input, 0, -4 ) . 'k';
       		} elseif ( $input_count == '2' ) {
       			return substr( $input, 0, -8 ) . 'm';
       		} elseif ( $input_count == '3' ) {
       			return substr( $input, 0, -12 ) . 'bn';
       		} else {
       			return;
       		}
       	} else {
       		return $input;
       	}
       }
       add_filter( 'tptn_post_count_only', 'tptn_restyle_count' );
       ```
   
 * Numbers are reduced from 32 000 to 32, But without the letter “k”, and again,
   space or comma doesn’t change anything
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] How to convert 1000 to 1k, 1 000 000 to 1m](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/#post-10973499)
 * for example this page [https://onibi.ru/manga/fox-girls-are-better/](https://onibi.ru/manga/fox-girls-are-better/)
   
   tptn_counter is on the right, near the eye icon.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] How to convert 1000 to 1k, 1 000 000 to 1m](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/#post-10964599)
 * It did not work. The number has not changed. How was 31000 and 31000 left
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WebberZone Top 10 — Popular Posts] How to convert 1000 to 1k, 1 000 000 to 1m](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/)
 *  Thread Starter [unclebobby](https://wordpress.org/support/users/unclebobby/)
 * (@unclebobby)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/how-to-convert-1000-to-1k-1-000-000-to-1m/#post-10955357)
 * I added a filter at the end of the file counter.php
 *     ```
       add_filter( 'tptn_post_count_only' , 'restyle_text' );
       ```
   
 * and added a function in the file function.php
 *     ```
       function restyle_text($input){
           $input = number_format($input);
           $input_count = substr_count($input, ',');
           if($input_count != '0'){
               if($input_count == '1'){
                   return substr($input, 0, -4).'k';
               } else if($input_count == '2'){
                   return substr($input, 0, -8).'mil';
               } else if($input_count == '3'){
                   return substr($input, 0,  -12).'bil';
               } else {
                   return;
               }
           } else {
               return $input;
           }
       }
       ```
   
 * And the numbers began to decline, but the letter is not added. That is, the number
   29993 has changed just to 29 without the “k”.
 * I do not understand why. Try this code and tell me if you succeed

Viewing 8 replies - 1 through 8 (of 8 total)