builder 8 Posted February 26, 2018 How would I write a macro to give me the number of risers x the riser height for a flight of stairs? What I am attempting to do is give the total rise of the stair. The "next_height" macro command does not work because it references the subfloor height which adds 3/4" more than the actual total rise of the stairs. So what I want to do is multiply this, number = riser_height divisor = 1/16.to_f a = ((number/divisor).round*divisor).divmod(12) feet = a[0] inches = a[1].floor if a[1].modulo(1) == 0 fraction = "" else fraction = " #{a[1].modulo(1).rationalize}" end "#{feet}'-#{inches}#{fraction}\"".reverse.chomp("-'0").chomp(" 0").reverse.chomp("-0\"") By this, total_risers Thank you for any help with this, Bob Share this post Link to post Share on other sites

solver 1121 Posted February 26, 2018 Try this. number = riser_height * total_risers divisor = 1/16.to_f a = ((number/divisor).round*divisor).divmod(12) feet = a[0] inches = a[1].floor if a[1].modulo(1) == 0 fraction = "" else fraction = " #{a[1].modulo(1).rationalize}" end "#{feet}'-#{inches}#{fraction}\"".reverse.chomp("-'0").chomp(" 0").reverse.chomp("-0\"") Share this post Link to post Share on other sites

builder 8 Posted February 26, 2018 Thank you Eric that helps me a lot. Bob Share this post Link to post Share on other sites