Calculation in custom HTML widget
-
Hi,
I’m using a donations widget on a crowdfunding website, that shows the number of donations, goal amount, raised so far and percentage raised. For ‘raised so far’ it uses this in the PHP code:
<span class="value"><?php echo '€' . number_format( get_option( 'donations_total_raised' ), 2, ',', '.' ); ?></span>
. Wherever I put this in a template, it nicely gives back the total amount raised.The crowdfunding project has several stages, each with a unit price of €1750. Now I would like to use this PHP code in a calculation in HTML:
I want to devide the ‘amount raised so far’ by 1750 and always round it down to a whole number (1.9999 is still 1…), so it will show the number of stages that have been fully completed so far.
How can I do this? I’ve searched on the internet, but did not find a clear answer. Any help is welcome.
- The topic ‘Calculation in custom HTML widget’ is closed to new replies.