I have recently begin updating an old Progam that was classic ASP with SQL Server 2000 to VB.Net and SQL Server 2005.
I am displaying some data in a text box from a SQL Server datatype decimal(18,6). 6 decimal places are always displayed regardless of the actual values.
For example: The textboxes in VB.net are displaying values such as 17.100000, 0.821300. I want the number to display without the trailing zeros. Such as 17.1 or 0.8213.
In the previous code, the trailing zeros did not display this must be something new with either VB.net or SQL Server 2005.
Two questions:
1) What changed in VB.net or SQL Server 2005?
2) How do I get rid of the trailing zeros? If there was a standard length I could easily use Round() or Format(), but the length varies. Any ideas?
Thanks
Start Free Trial