title: SQL Server not passing decimal value through to C#
body: <p>I am trying to call a function that returns a decimal value to my C# website. When I call the function inside SQL Server the trailing decimal values are present. But when it gets passed into C# the trailing decimals are missing.</p>
  
  <p>This is my SQL Server stored procedure being called:</p>
  
  <pre><code>declare @MonthlyTotal as decimal(10,2)
  set @MonthlyTotal=(select cast((Linetotal * Subtotal) as decimal(10,2)))
  return @MonthlyTotal
  </code></pre>
  
  <p>Inside my C# server code I am receiving the stored procedure value. But it does not come with the trailing decimals.</p>
  
  <pre><code>SqlConnection sqlConnection = new SqlConnection(Connection);
  
  SqlCommand cmd4 = new SqlCommand();
  cmd4.Connection = sqlConnection;
  cmd4.CommandType = CommandType.StoredProcedure;
  cmd4.CommandText = "GetTBSMonthlyTotalService";
  
  SqlParameter JobParam = new SqlParameter("MonthlyTotal", SqlDbType.Decimal, 10);
  JobParam.Precision = 10;
  JobParam.Scale = 2;
  JobParam.Direction = ParameterDirection.ReturnValue;
  
  cmd4.Parameters.Add(JobParam);
  
  try
  {
      sqlConnection.Open();
  }
  catch (Exception err)
  {
      Console.WriteLine(err.Message);
  }
  
  cmd4.ExecuteNonQuery();
  
  double ID = Double.Parse((cmd4.Parameters[0].Value.ToString()));
  sqlConnection.Close();
  return ID;
  </code></pre>