[Gambas-user] format number messing up equation
Neil Fallon
nfallo at ...734...
Mon Mar 7 01:20:15 CET 2005
Hi Pablo,
That would make sense with the results that I was coming up with.
Neil
On Sun, 2005-03-06 at 16:58 -0600, Pablo Vera wrote:
> When using the % sign in the format function, it will automatically
> multiply the value by 100, so you would use it like this:
>
> 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,"##.# %") &
> "\n\n" )
>
> Saludos,
> Pablo Vera
>
> Neil Fallon wrote:
> > 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
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> >
> >
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list