Status: offline

sorenson2743

Forum User
Newbie
Registered: 06/16/05
Posts: 13
Rather than have each poll answer shown as "xx.yy%"in the block, I would like to remove the ".yy" part and just be left with "xx%". I don't care if the total is +/- 100% because of round ups or round downs.

Is there an easy way to do this? TIA.

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
I guess this is what you want to change (in function COM_pollResults in lib-common.php):
Text Formatted Code
$poll->set_var( 'answer_percent',
                sprintf( '%.2f', $percent * 100 ));
 

bye, Dirk

sorenson2743

Anonymous
Thanks, Dirk. That's did the trick.

Status: offline

sorenson2743

Forum User
Newbie
Registered: 06/16/05
Posts: 13
Forgot to mention, for other readers, that just replacing the "2" in Dirk's reference with "0" changes it to no decimal points. A "1" would insert one decimal point.