Advertisement

06.05.2008 at 08:35AM PDT, ID: 23460660
[x]
Attachment Details

Remove Trailing Zeros

Asked by yonbret in Visual Studio .NET 2005, Programming for ASP.NET, SQL Server 2005

Tags: VB.Net, IE

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?

ThanksStart Free Trial
[+][-]06.05.2008 at 09:11AM PDT, ID: 21721149

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 09:40AM PDT, ID: 21721423

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Studio .NET 2005, Programming for ASP.NET, SQL Server 2005
Tags: VB.Net, IE
Sign Up Now!
Solution Provided By: chapmandew
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.05.2008 at 09:42AM PDT, ID: 21721446

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 09:43AM PDT, ID: 21721454

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.05.2008 at 10:31AM PDT, ID: 21721935

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628