 |
zogalogran Beginner
Joined: 23 Jun 2006 Posts: 20
|
Posted: 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! |
|
|
 |
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Sat Mar 10, 2012 11:12 pm |
do this, #MATH weight %format(2,((%float(@weightlb) + %format(2,%float((@weightoz/16.0))))))
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4752 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
 |
zogalogran Beginner
Joined: 23 Jun 2006 Posts: 20
|
Posted: Sun Mar 11, 2012 12:11 am |
Thanks. I figured it was something arcane - and I was right!
|
|
|
 |
|
|