[Gambas-user] format number messing up equation

Neil Fallon nfallo at ...734...
Sun Mar 6 04:07:40 CET 2005


Hi,

When using the Format$ to format the output of a number I am getting the
wrong result.  If I don't use it I get the correct result.

Code works

Message.Info("You answered " & countCorrect & " questions correct.\n\n"
& "You answered " & countWrong & " questions wrong." & "\n\n\n" & "Your
score for this test is " & countCorrect/counter*100 & "%\n\n" )


Doesn't work

Message.Info("You answered " & countCorrect & " questions correct.\n\n"
& "You answered " & countWrong & " questions wrong." & "\n\n\n" & "Your
score for this test is " & Format$(countCorrect/counter*100,"##.# %") &
"\n\n" )

With the section that doesn't work I am getting results like 5000%
instead of 50%

Neil

 





More information about the User mailing list