Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
kurosh
Beginner


Joined: 01 May 2002
Posts: 18

PostPosted: Sun Feb 16, 2003 7:18 am   

Using decimals?
 
Does zmud not support decimals? When I try to use some in math it just screws up. I've tried doing *.01 and *(1/100) both give me wrong results... What I'm trying to do is I get a message like this
"You receive 10% of the experience points needed to level."
So I'm trying take the number and divide it by 100 so I can multiply it by my TNL and figure out how much exp I gained.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 16, 2003 12:04 pm   
 
Upgrade to 6.40

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Feb 17, 2003 6:36 am   
 
zMUD uses integers by default. It's possible to use decimals with %float or 0.01 (using the latest public version). However, that's not really needed for your intended use. Just do all the multiplication first (should work with almost any version).

#TR {You receive (%d)~% of the experience points needed to level} {#SAY You got about %eval( @TNL * %1 /100) experience.}

LightBulb
Advanced Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net