nevershown
nevershown

Reputation:

VB.NET Double Question

Currently I have a Double which looks like 12.53467345 .. Now I would like to remove the numbers after the dot so i just get "12" , how could i do this? I guess with TryParse, but don't really understand how to do it.

Thanks!

Upvotes: 0

Views: 381

Answers (2)

Beth
Beth

Reputation: 9607

or use the Int() function.

' This code requires Option Strict Off
Dim MyNumber As Integer
MyNumber = Int(99.8)

MSDN Ref

Upvotes: 0

Mitch Wheat
Mitch Wheat

Reputation: 300559

System.Math.Floor()

Ref.

Upvotes: 7

Related Questions