ID:168324
 
Hey,

Just want to know if anyone has come up with a conversion system for inches to feet in DM. I have an input in my game in progress, and need the inches to calculate "something". But I want to have the height displayed in feet (ie. 6'1"). I will need this for one of my stat panels. If you could help me out with this I would be very greatful. Thanks.

Plagu3r
Are you kidding? Spend a minute thinking before you ask how to put two and two together.

#define feet2inches(inches) "[((inches)-(inches)%12)/12]'[(inches)%12]''"
In response to PirateHead
Maybe I should have thought a bit more. Thanks though.
In response to PirateHead
Or you could've done it like this.
#define inches2feet(inches) "[round(inches/12)]'[inches%12]''"


I like mine better, it's shorter. You were right though, who can't figure out a way to convert inches to feet, especially with a program.

Perhaps he's 7 years old. In that case, I congragulate him with his typing, it's not bad at all for his age. (Hypothetically speaking, that is.)

If you want to convert it back, though... Do this. I can't think of a way to #define it, so I'll just use a normal proc.
proc/feet2inches(string)
var/feet=text2num(copytext(string,1,findtext(string,"'")))
string=copytext(string,length(feet)+1)
var/inches=text2num(string)
inches+=feet*12
return inches


You know, just in case you want it.