Forums / Install & configuration / Wrong percentage in poll

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Wrong percentage in poll

Author Message

Kristoffer Karlsson

Wednesday 30 May 2007 6:17:49 pm

The percentage calculation in my poll is wrong.

63 votes of 116 is 35%
26 votes of 116 is 15%

Obviously that is not right...

I guess there must be something wrong in the following code. Am I right?

{let percentage = cond( $total_count|gt( 0 ), round( div( mul( $:item_count, 100 ), $total_count ) ), 0 )
                         tenth      = cond( $total_count|gt( 0 ), round( div( mul( $:item_count, 10 ), $total_count ) ), 0 )}

_____________________________________
Blog: http://www.kristofferkarlsson.com
Website: http://www.spelkanalen.com

Kristoffer Karlsson

Thursday 31 May 2007 12:31:33 am

I copied the template from http://svn.ez.no/svn/extensions/ezwebin/trunk/packages/ezwebin_extension/ezextension/ezwebin/design/ezwebin/templates/content/collectedinfo/poll.tpl

...but I still get the same result.

2 votes of 5 = 1%
3 votes of 5 = 2 %

Strange...

Ideas?

_____________________________________
Blog: http://www.kristofferkarlsson.com
Website: http://www.spelkanalen.com

Łukasz Serwatka

Thursday 31 May 2007 1:27:03 am

What happen when you clear the view cache? I did quick test and count works correct here.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Kristoffer Karlsson

Thursday 31 May 2007 1:05:46 pm

Cleared cache

Still the same result...

_____________________________________
Blog: http://www.kristofferkarlsson.com
Website: http://www.spelkanalen.com