Calculation Errors?

Need help running MacroQuest 1? Too bad! Use MQ2.

Moderator: MacroQuest Developers

GD
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jun 29, 2002 11:57 pm

Calculation Errors?

Post by GD » Sat Jul 06, 2002 10:49 am

Ok, I was trying to do plat calulations with MQ this morning, but each time it was messed up.

For example, on my person I have the following coins:

122 plat
6 gold
3 silver

That's 122.63pp total

However, if i run the following code...

Code: Select all

Sub Main
	/echo You have $char(plat)pp, $char(gold)gp, $char(silver)sp
	/echo Method 1: $calc($char(plat)*10+$char(gold)*10+$char(silver)/100)pp
	/echo Method 2: $calc($char(silver)/10+$char(gold)/10+$char(plat))pp
/return
I get:

[MacroQuest] You have 122pp, 6gp, 3sp
[MacroQuest] Method 1: 1280.03pp
[MacroQuest] Method 2: 122.90pp

This is with Version 2002-07-06, which I just downloaded about 10 minutes ago.

Am I missing something here?

seeker
decaying skeleton
decaying skeleton
Posts: 6
Joined: Sun Jun 16, 2002 2:07 pm
Location: Seattle, WA

Post by seeker » Sat Jul 06, 2002 12:11 pm

Method 1.. Looks like you are multiplying the plat by 10 first.. And the gold by 10..

((plat)+(gold)/10+(silver)/100)pp

For Method 2..
Looks like you didn't divide silver correctly..

((silver)/100+(gold)/10+(plat))pp