Hi there. Using Twine 1.4.2
fixed the decimal issue <<$height>>cm <<print (($height * 0.39370 / 12).toFixed(2))>> (see first comment for more info)
I am still looking for a neater way to show height in CM and in feet... but I suspect that the simplest answer will be to enter the info in Inches and then convert to feet and CM...
Incidently, is it possible to divide the inch-result by 12, then subtract that result to leave the remaining inches.
EG: 121 inches becomes 10 and 1?
I'm going to keep grinding at it... but any assistance is appreciated. I'm very new to programming and am liable to make all kinds of space-taking mistakes haha
I am trying to show a characters height ($height) and want to show a vague cm-in conversion. At least getting the right number of feet.
I'm currently using:
Height: <<$height>>cm <<print $height * 0.39370>>in
Trying to apply your <<set $var3 to Number(($var1 / $var2).toFixed(1))>> has sadly fried my tiny little brain... Programming isn't something I am that skilled with (proud to have gotten this far) but I think it should be possible to at least divide the result of the 'inches' result by 12... but then I need to limit the decimal places.
Of course, I'd love to know if there's a better way of converting these numbers.
The 'player' enters the height themselves (two inches tall? ok. if you want...) and I want to be able to use it for comparisons later (larger than, less than. print 'you hooge!' or 'puny lill playerperson!')
thanks in advance for any help