TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

#math question on decimal places

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Gandolf



Joined: 18 Oct 2005
Posts: 12
Location: Milwaukee, WI

PostPosted: Thu Dec 01, 2005 12:03 am    Post subject: #math question on decimal places Reply with quote

Not being able to do some math is killing me.

Is there any way I can get tintin++ scripts to do math and show results with decimal places?

I want to take a number and divide by 1.1 or 0.9 depending on circumstances.

Code:

#math {somevar} {462 / 1.1}
#MATH EXP: UNKNOWN OPERATOR: .
#OK. $somevar IS NOW SET TO {0}.
#showme {SomeVar = $somevar}
SomeVar = 0


$somevar should be '420' after this calculation.

This isn't working as tintin++ doesn't recognize anything past the decimal place and errors out on me.

help?
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Dec 01, 2005 7:26 am    Post subject: Reply with quote

You could do 462 * 10 / 11 instead.

I've been thinking about adding floating point math, but I'm not entirely sure yet about the best way to go about that.
Back to top
View user's profile Send private message Send e-mail
Gandolf



Joined: 18 Oct 2005
Posts: 12
Location: Milwaukee, WI

PostPosted: Thu Dec 01, 2005 1:06 pm    Post subject: Reply with quote

Duh....

sometimes I just can't see the forest because there are too many trees in the way.

Thanks. Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group