Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Howto: round up nr’s (dont know the word)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Topic: Howto: round up nr’s (dont know the word)
    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..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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()
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 09 November 2003 at 8:02am

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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.