OpenNTF.org - Open Notes Picture Database
Open Notes Picture DatabaseOpenDocument[/Projects/pmt.nsf/ProjectView?ReadForm&Query=]

My Links (Not logged in)
User Name Password
Hosted by Prominic.NET

   Project: Open Notes Picture Database (Managed by Christian Brandlehner)
Actions:

Hide details for The bugThe bug
Bug ID: NOSS-638CUC
Description
Submitted by:Christian Brandlehner
Project Master Chef:Christian Brandlehner
Bug type:UI
Brief Description:Stars are not calced correct in all conditions
Severity:Low
Version1.0.5
Status:

Details
Sometimes a picture shows more stars than rated. So for example four and a half start for a rating of 3,5.

This is the broken formula. Maybe someone can find my error or a better solution?

_rating := rating_total / rating_times;
_roundrating := @Round(_rating);
_y := _rating - @Integer(_rating);
_z := _y * 10;
_part := @Round(_z);
_int := @Integer(_rating);
@If(rating_total <= 0 | rating_total="";"No ratings yet.";"Ratings so far: "+
@Text(_int) + "." + @Text(_part) + " based on "+ @Text(rating_times) + @If(rating_times = 1;" rating ";" ratings ") +
@Repeat( "<img src=\"red_star.gif\" width=\"14\" height=\"14\" alt=\"Star\">"; _roundrating) +
@If((_part > 4) & (_roundrating < 5);"<img src=\"half_star.gif\" width=\"14\" height=\"14\" alt=\"*\">";""))


Action taken
Status:Submitted
Implemented in Release:
Fix Details:
Modification history
Entered 25-Jul-2004 4:14 by Christian Brandlehner. Last Modified <none> by <none>.