EagleTempest
Technical User
VB6
Hello, shouldn't 15=15? My program allows for both Metric and Imperial input but I want the Imperial display shown as 15'-6 3/8". This I can accomplish but I notice if I convert from Imp. to Met to Imp, I sometimes lose one inch.
I made a test module which can be run in a blank project check it out.
The result is -3.5527136788005E-15.
Obviously I could stick the Round function in but I would think that shouldn't be nessessary.
Hello, shouldn't 15=15? My program allows for both Metric and Imperial input but I want the Imperial display shown as 15'-6 3/8". This I can accomplish but I notice if I convert from Imp. to Met to Imp, I sometimes lose one inch.
I made a test module which can be run in a blank project check it out.
Code:
Private Sub Form_Load()
Dim intInches As Integer
Dim dblInches As Double
Dim dblDifference As Double
'Convert 24inches to mm and back to inches
dblInches = 24 * 25.4
dblInches = dblInches / 25.4
intInches = 24
dblDifference = dblInches - intInches
Debug.Print dblDifference
End Sub
The result is -3.5527136788005E-15.
Obviously I could stick the Round function in but I would think that shouldn't be nessessary.