I want to set the precision or make sure i am getting the precision by 2 decimal points, at the moment once I read in the value, its rounded off to the nearest dollar if you know
what i mean.
Can some assist me. I want to set the precision by two decimal places.
if (reader["PRICE"] != DBNull.Value)
{
Row.PRICE= Convert.ToDecimal(reader["PRICE"]);
}
Loading

David SmithRank #999 · 2K reputationPosted Nov 3, 2011, 11:24 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Nov 6, 2011, 4:52 AM EST
VulpesRank #55 · 29.2K reputationPosted Nov 6, 2011, 5:06 AM EST
David SmithRank #999 · 2K reputationPosted Nov 6, 2011, 8:03 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Nov 6, 2011, 9:49 PM EST
VulpesRank #55 · 29.2K reputationPosted Nov 6, 2011, 11:44 PM EST
David SmithRank #999 · 2K reputationPosted Nov 7, 2011, 6:08 AM EST
VulpesRank #55 · 29.2K reputationPosted Nov 7, 2011, 6:17 AM EST
David SmithRank #999 · 2K reputationPosted Nov 7, 2011, 8:09 AM EST
my types were decimal (18,0) instead of decimal (18,2). I suck. I am so mad. I have beed tracing this for the last two days. Im glad i save this to the end. This would have killed me. lolololol
Suthish NairRank #92 · 22.8K reputationPosted Nov 7, 2011, 10:12 AM EST
David SmithRank #999 · 2K reputationPosted Nov 7, 2011, 11:40 AM EST
decimal (18,2)