Rounding Cubic Yard Label


JLU_Design
 Share

Recommended Posts

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.

image.thumb.png.d07a79821e9ae6242c6dad4c90eab14e.png

 

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

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

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

 

image.thumb.png.1b956f15a7d6a399889b1f983186b92c.png

 

This is a way to do it...

If someone has a better way let me know.

Thanks

Link to comment
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share