How do I stop a decimal from rounding off in asp.net?
Posted on 2004-09-10
I have a stored procedure returning a value of 34.7. when I display this in a label it is rounded off to 35.00. I tested the value in SQL Server Query Analyzer so I know I am stating off with 34.7. I assume I have a formating proplem.
here is my label code:
lblshipweight.Text = Format(myOrderDetails.ShipWeightTotal,"#00.00")
here is the pertinent code from the stored procedure:
@shipweighttotal decimal(10,2) OUTPUT
@shipweighttotal = Cast(SUM(CMRC_OrderDetails.Quantity * CMRC_OrderDetails.Weight) as decimal(10,2))
pertinent code from busines object (.vb file)
Dim myOrderDetails As New OrderDetails()
myOrderDetails.shipweighttotal = CDec(parametershipweighttotal.Value)