July 17th, 2013, 01:23 AM
Find rounding functions VB6.0 ?
I want to find rounding functions. In VB60. The function can be fulfilled in the for example below
794.5 = 795
843.4 = 843
245.345 = 245
I used the function: Round(), Int(), Fix() but not.
July 18th, 2013, 10:44 AM
Based on the numbers you provided, you want to round a single precision number to the nearest whole number. The "Int" function simply truncates the result.
The same technique can be used for other significant numbers by multiplying or dividing by powers of 10.
Private Sub cmdRound_Click()
Text1.Text = Int(Text1.Text + 0.5)
Text2.Text = Int(Text2.Text + 0.5)
Text3.Text = Int(Text3.Text + 0.5)
August 14th, 2013, 06:00 AM
Originally Posted by couttsj
apart from multiplying or dividing is their any other formula for this.
August 14th, 2013, 02:17 PM
For single or double precision numbers, you can use the Round function to adjust the number of decimal places. There is no function for rounding numbers to the left of the decimal place.
Originally Posted by PeterSullivan
August 15th, 2013, 07:38 PM
I don't know if this kb article will be helpful, but it looks to be a pretty complete discussion of rounding and different types of rounding.
Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.