Title: Decimals
Last modified: August 21, 2016

---

# Decimals

 *  Resolved [maddogmcewan](https://wordpress.org/support/users/maddogmcewan/)
 * (@maddogmcewan)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/decimals-1/)
 * How do you “remove decimals” as in just want 5600 points, rather than 5600.00
   points?
 * [https://wordpress.org/plugins/mycred/](https://wordpress.org/plugins/mycred/)

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

 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024547)
 * Hi.
 * Right now the setup you do on myCRED the first time you install the plugin is
   what is used. So if you setup myCRED to use decimals you can not change it to
   no decimals later.
 * In case you can not re-install or do not feel comfortable with adjusting SQL 
   tables on your own, the easiest solution would be to filter how points are displayed
   by always displaying points without decimals.
 * This is done via the mycred_format_creds filter which fires just before points
   are displayed. Here is a quick example of how you can remove decimals:
 *     ```
       add_filter( 'mycred_format_creds', 'remove_mycred_decimals' );
       function remove_mycred_decimals( $amount ) {
       	return number_format( (int) $amount, 0, '.', '' );
       }
       ```
   
 *  Thread Starter [maddogmcewan](https://wordpress.org/support/users/maddogmcewan/)
 * (@maddogmcewan)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024550)
 * aaaah – no worries – in which table is that stored – i can edit in db
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024552)
 * There are two things you would need to change:
 * 1. You would need to change the myCRED_log table ( prefix_myCRED_log ) and you
   would need to change the core settings to stop showing decimals. The myCRED core
   settings are stored in the options table under the key: mycred_pref_core. It 
   contains an associative array of settings and under “format” you will see “decimals”
   having a value of 2. Change this to zero.
 * In 1.5 I am working on adding the option to change this via a button but right
   now unfortunately your setup is enforced.
 *  Thread Starter [maddogmcewan](https://wordpress.org/support/users/maddogmcewan/)
 * (@maddogmcewan)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024554)
 * thanx for that – done !!!! my log table was empty though
 *  [fresh-x](https://wordpress.org/support/users/fresh-x/)
 * (@fresh-x)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024740)
 * hey, i also now wanted to cut the value after the point, just like that from 
   100.00 to 100 points, so with a little jquery script u also can do this – works
   well, by display points inside a <span class=”one”>…</span>
 *     ```
       var points = Math.round($("span.one").text());
       $("span.one").html(points);
       ```
   
 * maybe is useful for some others, they may also dont want to change core things
   in plugin.
 *  Plugin Author [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * (@designbymerovingi)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024742)
 * [@fresh-x](https://wordpress.org/support/users/fresh-x/) thanks for the suggestion.
   I do recommend that if you want to remove decimals you use the [mycred_format_creds](http://codex.mycred.me/filters/mycred_format_creds/)
   filter which myCRED provides:
 * Basic example:
 *     ```
       add_filter( 'mycred_format_creds', 'mycred_pro_remove_decimals' );
       function mycred_pro_remove_decimals( $amount ) { return (int) $amount; }
       ```
   
 * The above code goes into your theme’s functions.php file and will be applied 
   to all point types.

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

The topic ‘Decimals’ is closed to new replies.

 * ![](https://ps.w.org/mycred/assets/icon-128x128.gif?rev=3512531)
 * [Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program - myCred](https://wordpress.org/plugins/mycred/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mycred/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mycred/)
 * [Active Topics](https://wordpress.org/support/plugin/mycred/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mycred/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mycred/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [myCred](https://wordpress.org/support/users/designbymerovingi/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/decimals-1/#post-5024742)
 * Status: resolved