I am total begineer in ruby so its very novice question.
I am trying to concatenate a string with a float value like follows and then printing it.
puts " Total Revenue of East Cost: " + total_revenue_of_east_cost
total_revenue_of_east_cost is a variable holding float value, how i can make it print?
This isn’t exactly concatenation but it will do the job you want to do:
Technically, this is interpolation. The difference is that concatenation adds to the end of a string, where as interpolation evaluates a bit of code and inserts it into the string. In this case, the insertion comes at the end of your string.
Ruby will evaluate anything between braces in a string where the opening brace is preceded by an octothorpe.