About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
zogalogran
Beginner


Joined: 23 Jun 2006
Posts: 20

PostPosted: Sat Mar 10, 2012 10:56 pm   

#math problems
 
I've tried numerous permutations of %float and %format to get this right, but it's still not working - so I come begging once again for help!

#MATH weight %format(2,((%float(@weightlb) + %format(2,%float((@weightoz/16))))))

Basically, if @weightlb = 2 and @weightoz = 4, @weight should = 2.25. The above (and every other version I've tried) always returns 2.00.

What gives?

Thanks!
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: Sat Mar 10, 2012 11:12 pm   
 
do this, #MATH weight %format(2,((%float(@weightlb) + %format(2,%float((@weightoz/16.0))))))
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4752
Location: Pensacola, FL, USA

PostPosted: Sat Mar 10, 2012 11:37 pm   
 
#MATH is depreciated in CMUD, just enclose your equation in parenthesis
The %float function is unneeded so long as one of the numbers in your equation is already floating point.

weight=%format(2, (@weightlb+(@weightoz/16.0)))
_________________
Discord: Shalimarwildcat
Reply with quote
zogalogran
Beginner


Joined: 23 Jun 2006
Posts: 20

PostPosted: Sun Mar 11, 2012 12:11 am   
 
Thanks. I figured it was something arcane - and I was right!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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