I have a stored procedure which is not returning correct value, for eg. it should return 33.30 but it returns 33.00 which is not desired result. this is my stored procedure ,i'm using SQL server 2008
ALTER PROCEDURE [dbo].[sp_UpdateStockForSale]
@prodName varchar(40),
@stqty numeric(9,2),
@batchno varchar(40),
@IsSample varchar(5)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @S_en int;
DECLARE @ttavail numeric(9,0);
DECLARE @ttsold numeric(9,0);
DECLARE @Nr decimal(9,2);
DECLARE @NetRate decimal(9,2)
SET @NetRate=0.0;
While (@stqty > 0) BEGIN
Select @S_en=S_en,@ttavail=S_P_ttavail, @ttsold=S_P_ttsold,@Nr=NetRate From STOCK WHERE S_P_ttavail>0 AND S_P_name = @prodName AND S_P_batchno=@batchno And IsSample=@IsSample Order By S_en DESC;
--If Sale Qty is more than Stock
IF (@ttavail <= @stqty) BEGIN
SET @stqty = @stqty - @ttavail;
SET @ttsold=@ttsold + @ttavail;
SET @NetRate=@NetRate+(@Nr*@ttavail);
Print (@NetRate);
SET @ttavail = 0;
END
--If Sale Qty is less than STOCK
ELSE IF(@stqty < @ttavail) BEGIN
SET @ttsold = @ttsold + @stqty
SET @ttavail = @ttavail - @stqty;
SET @NetRate=@NetRate+(@Nr*@stqty);
Print (@NetRate);
SET @stqty = 0;
END
Update STOCK Set S_P_ttavail = @ttavail, S_P_ttsold=@ttsold Where S_en=@S_en And IsSample=@IsSample
END
print @NetRate
return @NetRate
END
when I execute it in SSMS I get result

and message which is showing values i printed ,which shows data fetching n calculations are giving right result [see last printed value] .
I need this value to save in another table ,so this is C# code
cmd = new SqlCommand("sp_UpdateStockForSale ", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@prodName", dataGridView1.Rows[i].Cells["P_name"].Value);
cmd.Parameters.AddWithValue("@stqty", dataGridView1.Rows[i].Cells["P_otabs"].Value); //total tabs
cmd.Parameters.AddWithValue("@batchno ", dataGridView1.Rows[i].Cells["P_batch_no"].Value);
cmd.Parameters.AddWithValue("@IsSample ", dataGridView1.Rows[i].Cells["IsSample"].Value);
var returnParameter = cmd.Parameters.Add("@NetRate", SqlDbType.Decimal);
returnParameter.Direction = ParameterDirection.ReturnValue;
cmd.ExecuteNonQuery();
var result = returnParameter.Value;
please help me .thanks.
@return_valuedecimal(18,2) for example??RETURNfrom a sproc is used to return an integer error code. If you want to output a value, you should use an OUTPUT parameter (or more typically, just SELECT it and have the caller read the value).sp_prefix for your stored procedures. Microsoft has reserved that prefix for its own use (see Naming Stored Procedures), and you do run the risk of a name clash sometime in the future. It's also bad for your stored procedure performance. It's best to just simply avoidsp_and use something else as a prefix - or no prefix at all!