Strange smallmoney in MS sql to decimal in .Net

I have smallmoney value in db as 25.00, when I read it .net decmial it became 25.0000 on asp.net gridview. where did he hook the extra two digits?

0


source to share


3 answers


This is entirely a consequence of the formatting - the actual value in the database is only 25 in both cases.



+1


source


It's just a case of precision and default display of various formats. If you want your data to be displayed in a specific format, it is best to clearly state that format.



0


source


smallmoney and money in SQLServer have at least four digits after the decimal.

Formatting in SQL is probably not relevant to your scenario, but if you format it in SQL you have several options.

0


source







All Articles