JLU_Design Posted January 5 Share Posted January 5 I've been stumped on this for a while. I want the volume of a concrete slab displayed in cubic yards rounded to one decimal point in the label. What I'm using in the label: %thickness% Concrete Slab %volume.to_s('cu yd')% Can anyone point me in the right direction? Thanks in advance. Link to comment Share on other sites More sharing options...
JLU_Design Posted January 5 Author Share Posted January 5 14 minutes ago, solver said: Ruby is a programming language, not something exclusive to Chief, so a web search will find syntax to try. And a forum search should also find some helpful info as rounding is a common question. I understand and have done that. .round does not work for some reason I thought someone familiar with Ruby and Chief might be able to quickly tell me what I need to do. I've messed around with this off and on for several months. Link to comment Share on other sites More sharing options...
JLU_Design Posted January 5 Author Share Posted January 5 Well, I guess I just needed to ask to figure out a solution my self. %thickness% Concrete Slab %volume.to_s('cu yd')% %((volume.to_f)/27).ceil(1)% cu yd This is a way to do it... If someone has a better way let me know. Thanks Link to comment Share on other sites More sharing options...
JLU_Design Posted January 5 Author Share Posted January 5 4 minutes ago, solver said: Try the line in bold. %thickness% Concrete Slab %volume.to_s('cu yd')% %(volume/27).round(1).to_f% CU YD Thankyou! That looks better I think. Not so many brackets. This is what I'm using after your input: %thickness% Concrete Slab %(volume/27).ceil(1).to_f% cu yd Because I decided I want it rounded up. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now