Forums - C# Corner

Forum guidelines

C# Set precision

Nov 4 2011 3:14 AM
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"]);

Answers (11)

Startup Conference 2016


Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.