title: Converting to decimal and then to varchar in linq to sql
body: <p>I used to have a stored procedure which would simply call</p>
  
  <pre><code>SELECT item = CONVERT(VARCHAR(6), CONVERT(DECIMAL(5, 2), (t.aNumber/(t.aSecondNumber+ .0000000000001)) * 100)) + ' %',
  FROM table t;
  </code></pre>
  
  <p>to get a percentage value.</p>
  
  <p>I wish to update this, and call it in my linq to sql query, however I cannot figure out how to do this in the object instantiation. So, at the moment I have : </p>
  
  <pre><code>using (context db = new context(ConnectionString))
                  {
                      var versions =
                                  from t1 in db.table
                                  select new CustomObject
                                  {
                                      Id = t1.ID,
                                      Item = (t1.aNumber/(t1.aSecondNumber+ .0000000000001)) * 100,
  
                                  };
                   }
  </code></pre>
  
  <p>But this will not work the same as my query above, how can I write convert it in the same way as above using the linq to sql syntax I am using, in the object instantiation ?</p>
  
  <p>Thanks very much</p>