Posted: Mon Dec 03, 2001 12:48 pm
Restored from previous forum. Originally posted by willinyork.
Hi! Thanks for all your help, it worked like a charm
However I am stuck on one last thing before I can finish my program
Is there any way of doing this with numbers that have a decimal point in them? Basically, I have 2 string gadgets for the user to enter a value, a button to perform a calculation, and another string gadget to display the answer. If you type in 125 in the first gadget (gadget 50), then 4 in the second gadget (gadget 51) and click the button, it should return a value of 1.92, but doing it like this return 2 (the nearest whole number).
tempobpm.l=Val(GetGadgetText(50))
beats.l=Val(GetGadgetText(51))
length.f=((60/tempobpm)*beats)
length$=Str(length)
SetGadgetText(52, length$)
I would like to have the answer displayed at least 2 decimal places, preferably 3 if possible. Is this the right way to go about things? A friend of mine mentioned something about floating points, so I don't know whether I'm missing something obvious or not
Thanks!
Hi! Thanks for all your help, it worked like a charm

However I am stuck on one last thing before I can finish my program

tempobpm.l=Val(GetGadgetText(50))
beats.l=Val(GetGadgetText(51))
length.f=((60/tempobpm)*beats)
length$=Str(length)
SetGadgetText(52, length$)
I would like to have the answer displayed at least 2 decimal places, preferably 3 if possible. Is this the right way to go about things? A friend of mine mentioned something about floating points, so I don't know whether I'm missing something obvious or not
