title: Can I concatenate strings in Elixir and use the pipe operator?
body: <p>In Elixir, you can concatenate strings with the <code>&lt;&gt;</code> operator, like in <code>"Hello" &lt;&gt; " " &lt;&gt; "World"</code>. </p>
  
  <p>You can also use the pipe operator <code>|&gt;</code> to chain functions together.</p>
  
  <p>I'm trying to write the Elixir code to format the currency for an online game.</p>
  
  <pre class="lang-elixir prettyprint-override"><code>def format_price(price) do
    price/10000
    |&gt; Float.round(2)
    |&gt; to_string
    |&gt; &lt;&gt; "g"
  end
  </code></pre>
  
  <p>The above results in a syntax error. Am I overlooking a basic function that can concatenate strings? I know I can define one myself, but that seems like creating unnecessary clutter in my code if I can avoid it.</p>
  
  <p>I realize I can accomplish the same thing, by simply chaining the methods together like <code>to_string(Float.round(price/10000, 2)) &lt;&gt; "g"</code>, but this syntax isn't as nice to read, and it makes it more difficult to extend the method in the future, if I want to add steps in between.</p>
  
  <p>Does Elixir have ways to concatenate text using the pipe operator, or is that not possible without defining the method yourself?</p>