Remove Decimal Places from Donation Levels

Options

Has anyone had any success removing the .00 from donation levels on donation forms?  This seems like it should be relatively simple to do, but I can't figure it out.

Tagged:

Comments

  • Kent Gilliam
    Kent Gilliam Blackbaud Employee
    Ancient Membership Facilitator 4 Name Dropper Photogenic

    One thing you can do is use the label of the amount instead of the actual level amount. If you have a $35.00 level you can label it "$35" and display that instead of the level amount. You do this when you edit the "donation level" data element in "Design Donor Screens". You can add the label but make sure you have the option below unchecked so it won't show the label and the level amount:

     

     5.Level Amount:  Choose this option to display the amount of the level to the donor.Yes, display the level amount to the donor. Step 5.



  • Will Hull
    Will Hull Blackbaud Employee
    Ancient Membership Facilitator 1 Photogenic
    A way that I have done it with Pagewrappers is to add jQuery to remove the .00 off of dollar amounts, but the preferred method is to turn off display giving level amounts and write in your label value (what Kent Gilliam‍ mentioned on the other response to this post).

     

    If you want to add the jQuery to the Pagewrapper or in an HTML Caption on a donation form, you can use the code below and it will remove the .00 on any giving levels.

    <script type="text/javascript"><br /><br/>Y.use('jquery-noconflict', function() {<br /><br/>jQuery(document).ready(function() {<br /><br/>jQuery(this).html(jQuery(this).html().replace(".000","").replace(".00","").replace(".0",""));<br /><br/>});<br /><br/>});<br /><br/></script>
  • Will Hull
    Will Hull Blackbaud Employee
    Ancient Membership Facilitator 1 Photogenic

    Hey there, everyone.

    Here is an update to the code above.  I didn't include the part of the code where it looks at each giving level.  Please find it below:

    <script type="text/javascript"><br /><br/>Y.use('jquery-noconflict', function() {<br /><br/>jQuery(document).ready(function() {<br /><br/>//This is the function that removes the .00 from donation giving level amounts<br /><br/>jQuery('.donation-level-amount-container').each(function(){<br /><br/>jQuery(this).html(jQuery(this).html().replace('.000','').replace('.00','').replace('.0',''));<br /><br/>});<br /><br/>// End of function that removes .00 giving level amounts<br /><br/>});<br /><br/>});<br /><br/></script>

    Thanks

Categories