title: Format number with space as thousand separator
body: <p>First: Yes I know number formatting shall not be done in data layer, but I'm working with  an application I can't modify, nor can I format the result set in the application. I can only write a query.</p>
  
  <p>For a SQL Server 2008 query I want to use space as thousand separator and also round to two decimals. Example: <code>123363.249999</code> should be displayed as <code>123 363,25</code>.</p>
  
  <p>I've tried:</p>
  
  <pre><code>SELECT REPLACE(CONVERT(varchar, CONVERT(money, 123363.249999), 1), '.00', '')
  </code></pre>
  
  <p>But that results in <code>123,363.25</code>. I'm looking for nicer solution than just replacing comma with space and dot with comma. It would be nice to set the locale in the query.</p>