trouble with number rounding

laurie lauriebayet at gmail.com
Mon Sep 16 16:31:02 UTC 2013


Hello,

I am using a modified version of the "VisualScaleAnalog" script which is 
recording the position of a muse click on a scale.

Then it displays the recorded "score" to the user.

What the original script does is this

    Dim percent as Integer
    Mouse.GetCursorPos ptPress.X, ptPress.Y
    percent = 100*((ptPress.X-VAS_SliderDummy.Left)/sw)
    ...
    and then it displays "percent"

So the original script would display a score of "75" if the subject clicked 
on the 3/4th of the scale

What i want to display is something like "7.5" instead of "75".

I tried this :

    Dim percent as Integer
    Dim score as Double
    Mouse.GetCursorPos ptPress.X, ptPress.Y
    percent = 100*((ptPress.X-VAS_SliderDummy.Left)/sw)
    score=CInt(percent)/10
    ...
    and then display "score"

but then it would display something like "7.500121245" instead of just "7.5"
how can i format the score so that it shows to 1 or 2 decimal places?

thank you

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/84487198-c5d1-49b3-8e8d-268eee77b9f2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20130916/641cc218/attachment.htm>


More information about the Eprime mailing list