phpvoting-system

Display a non percent value for a progress bar


I have this code displaying a progress bar, I will input the value as 10, 15, 20 etc.. but I would like the first $design_value to be displayed as a vote from 0 to 10, so I should divide the value by 10, is there an easy way to print that in php? thanks

<div class="small-12 medium-3 columns hide-for-small">'.$design_value.'</div>
</div>
<div class="progress"> 
    <span data-width="'.$design_value.'" style="width:'.$design_value.'%;"></span>
</div>

Solution

  • Assuming I understood your question correctly...

    <div class="small-12 medium-3 columns hide-for-small">'.round($design_value / 10).'</div>
    </div>
    <div class="progress"> 
        <span data-width="'.$design_value.'" style="width:'.$design_value.'%;"></span>
    </div>