Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Calculating specific accuracy with decimals

Hi everyone,

I am building a Go-NoGo experiment and I want to show two types of accuracy feedback after each block:
1. the usual [acc] % for all sorts of responses. This works just fine and is displayed with two decimals (e.g. 83,33333 = 83,33%)
2. I want to give feedback about the accuracy only on NoGo-trials. The problem is that the result of my equation is always displayed without decimals (e.g. 73,33333 = 73%). I assume that the automatic variable type has something to do with it. Is there any possibility that the NoGo_acc is also shown with two decimals?

I calculate it in a python inline_script with this equation:
var.NoGo_acc = var.NoGo_corectr*100/var.NoGo_total

Thanks for your help!


  • Dear Bird ;)

    i had the same problem just yesterday!
    solved it this way:

    format(var.yourRT/1000, '.2f') + ' sec'

    There you go.

  • Just noticed it myself. You'll always get x.00 sec with that. :s

    Solution: format(var.yourRT/float(1000), '.2f') + ' sec'

    Now it works, i think.

  • Thanks Dahm.

    Actually I solved the problem just minutes after my post - how embarrassing. The only thing I needed to do was to put
    float (
    in front of the variables.

Sign In or Register to comment.