WordPress.org

Forums

Social Count Plus
[resolved] See numbers with decimal separator (7 posts)

  1. MZBS
    Member
    Posted 12 months ago #

    Hello,

    Would be nice when you have big numbers to see decimal separator.

    For example:

    instead of 6555 see 6.555
    instead of 10232 see 10.232
    instead of 234232 see 234.232
    instead of 1000000 see 1.000.000

    Thank you so much!

    https://wordpress.org/plugins/social-count-plus/

  2. Claudio Sanches
    Member
    Plugin Author

    Posted 12 months ago #

    Use this in your theme functions.php:

    function custom_social_count_plus_number_format( $number ) {
    	return number_format( $number, 0, '', '.' );
    }
    
    add_filter( 'social_count_plus_number_format', 'custom_social_count_plus_number_format' );
    
  3. MZBS
    Member
    Posted 11 months ago #

    Hello,

    I don't see any change adding those lines on functions.php.

    I need to change anything else?

    Thank you!

  4. Claudio Sanches
    Member
    Plugin Author

    Posted 11 months ago #

    Only this and will have to fix the display of the widget.
    However if you are trying to do this with something else, you will have to implement the function in it too.

  5. MZBS
    Member
    Posted 11 months ago #

    No,

    I am just using this <?php echo get_scp_twitter(); ?> etc in my sidebar and in the footer to get plain text of my fans in social networks and I want to see the decimal separation in those numbers.

    But nothing changes with the function in the functions.php

    Thank you!

  6. Claudio Sanches
    Member
    Plugin Author

    Posted 11 months ago #

    You can use it like:

    <?php echo number_format( get_scp_twitter(), 0, '', '.' ); ?>
    
  7. MZBS
    Member
    Posted 11 months ago #

    Great!

    That is working perfectly for me.

    Thank you so much!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.