locked
help with coding formula RRS feed

  • Question

  • User-2060576634 posted

    hi..

    can somebody help me with this code which is inside a loop?

    <td>(@db.Query(selectcorrectanswers + " AND ItemId=@1",userid,row.ItemId).Count * 3 - @db.Query(selectincorrectanswers + " AND ItemId=@1",userid,row.ItemId).Count) / (@db.Query(selectquestions + " AND ItemId=@0",row.ItemId).Count * 3)*100</td>
    

    what i see as output is this:
    (1 * 3 - 1) / (2 * 3)*100

    the numbers are right but the ultimate calculation doesn't take place

    I want a floating number with two digits of precision. thanks

    Sunday, February 1, 2015 6:39 AM

Answers

  • User1713851783 posted

    Place before your formula @((float)(@db.Query.....))

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 1, 2015 7:15 AM