Subject: POLLS: How remove ".xx" part?

Posted on: 17/06/05 01:15pm
By: sorenson2743

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.

POLLS: How remove ".xx" part?

Posted on: 17/06/05 02:41pm
By: Dirk

I guess this is what you want to change (in function COM_pollResults in lib-common.php):
$poll->set_var( 'answer_percent',
                sprintf( '%.2f', $percent * 100 ));

bye, Dirk

POLLS: How remove ".xx" part?

Posted on: 18/06/05 08:29pm
By: Anonymous

Thanks, Dirk. That's did the trick.

POLLS: How remove ".xx" part?

Posted on: 20/06/05 10:30am
By: sorenson2743

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.

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=54436