• Resolved Stanislav

    (@pigus)


    Hello! Is it possible to reduce the number of views if there are more than 1000. For example 1300=1.3K. I tried to do it with help. this code, but it didn’t work.

    function cp_convert_big_number($number) { $number = str_replace(',', '', $number); if ( $number >= 1000 ) { $number = number_format($number / 1000, 1) . 'K'; } else if ( $number >= 1000000 ) { $number = number_format($number / 1000000, 1) . 'M'; } else if ( $number >= 1000000000 ) { $number = number_format($number / 1000000000, 1) . 'B'; } return $number; } add_filter('number_format_i18n', 'cp_convert_big_number');

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dFactory

    (@dfactory)

    Hi,

    You have an option for that already in the plugin. It’s called Format Number located in Display page of PVC.

    If that option is enabled PVC is using WP native “number_format_i18n” function and you can use the “number_format_i18n” filter as above to further adjust the views display for your needs.

    • This reply was modified 4 months ago by dFactory.
    Thread Starter Stanislav

    (@pigus)

    Thank you very much! You have a wonderful plugin and support!



Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.