When displaying the value of a decimal currently with .ToString()
, it\'s accurate to like 15 decimal places, and since I\'m using it to represent dollars and ce
You can use system.globalization to format a number in any required format.
For example:
system.globalization.cultureinfo ci = new system.globalization.cultureinfo("en-ca");
If you have a decimal d = 1.2300000
and you need to trim it to 2 decimal places then it can be printed like this d.Tostring("F2",ci);
where F2 is string formating to 2 decimal places and ci is the locale or cultureinfo.
for more info check this link
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx