total inches = 63360*miles + 36*yards + 12*feet +inches
I need to calculate the total inches
total meters = total inches/39.97
Then convert it in meters
Kilometers = Int(meters/1000)
And then covert that into Metric. Now im lost. I tried :
VB Code:
  1. Dim miles, yards, feet, inches, kilometers As Single
  2.         Dim totalinches, totalmeters, totalcm As Double
  3.         miles = txtmiles.Text * 63360
  4.         yards = txtyards.Text * 36
  5.         feet = txtfeet.Text * 12
  6.         inches = txtinches.Text
  7.         totalinches = miles + yards + feet + inches
  8.         totalmeters = (FormatNumber(totalinches / 39.37, 0))
  9.         totalcm = (FormatNumber(totalinches / 3937, 1))
  10.         kilometers = Int(totalmeters / 1000)
  11.         txtansmetric.Text = "The metric length is         " & kilometers & " kilometers                  " & totalmeters & " meters                    " & totalcm & " centimeters."
which works, but it shows the Complete inches in Kilometers, the Complete inches in meters, and the Complete inches in Centimeters. I need to tamke it calculate perfectly, like:

Miles = 5
Yards = 20
Feet = 2
Inches = 4

which would result in:
the metric length is 8 kilometers, 65 meters, and 73.5 centimeters
Thanks to anyone that can help