August 21st, 2007

You are currently browsing the articles from Information City written on August 21st, 2007.

VB: Round up decimal value by truncate floating point

So I was searching for a method to get the integer value from a floating number but found a quick workaround towards the problem. Below is what I have come up with:

function convertInt(value as double) as integer
  dim arrayNo
  arrayNo=Split(value,”.”)
  convertInt=arrayNo(0)
end function

I believe the above function code is self explainatory. Anyone have a better way or suggestion?

Written by admin on August 21st, 2007 with 2 comments.
Read more articles on Personal and Programming.