Print Page | Close Window

Howto: round up nr’s (dont know the word)

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7114
Printed Date: 28 March 2026 at 11:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Howto: round up nr’s (dont know the word)
Posted By: Diep-Vriezer
Subject: Howto: round up nr’s (dont know the word)
Date Posted: 09 November 2003 at 7:16am

Hey,

I have a timer in my code-behind page like this:

Dim PageGeneratedTimer As Timer

.... < Code

lblPageStats.Text += vbCrLf & "Page generated in: 0." & Timer.ToString

Now, the Timer.ToString is like 10 digits long. How can I shorten this up in 3 digits? I can do it by putting the first 4 chars of the string, into another string, and write that one. But this doesn't includes the last chars, and .NET must have somesort of function to do it.

My question... How can I do this?



-------------
Gone..



Replies:
Posted By: Mart
Date Posted: 09 November 2003 at 7:47am
You can't use a rounding function because it will always round it to 0. The built in rounding function is Round()


Posted By: Diep-Vriezer
Date Posted: 09 November 2003 at 7:55am
I mean rounding up in about 3 chars. BTW the Round() function is not declared..  In what namespace is it?

-------------
Gone..


Posted By: Mart
Date Posted: 09 November 2003 at 8:02am

System.Decimal, can't use just use left(Timer.ToString, 3)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net