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
Rogdorsh
Newbie


Joined: 04 Mar 2002
Posts: 1

PostPosted: Sat Mar 16, 2002 4:56 pm   

variables [floating point]
 
What's the recommended way to deal with these? In a trigger that I have, @hasweight is something like 0.3 and I can't get that into the database as a number so I thought I'd multiply it by 10, but I'm out of luck =/. Ie:

quote:

#math @foo @hasweight*10
#ECHO |@foo|



... isn't doing much for me, what should I do, typecast it or something? =)
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Mar 16, 2002 9:24 pm   
 
The public version of zMUD can't deal with floating-point numbers. The beta version has support for it and Zugg is working on fixing bugs in it so that there will be another public version soon.

Meanwhile, the only way to handle it would be to store only the numbers and know that what you have stored in there is really the variable divided by 10 (although this will return zero so you can't do that directly). To store only the numbers you can do:
#VAR hasweight %replace(@hasweight, ".", "")

Kjata
Reply with quote
Rogdorsh
Newbie


Joined: 04 Mar 2002
Posts: 1

PostPosted: Sun Mar 17, 2002 1:10 am   
 
Ahhhhhh, many thanks, appreciated
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