# Try this

Posted by Will (92 GXE) on September 17, 2004 at 12:41:34: In Reply to: Quick question... posted by atulb84 on September 17, 2004 at 09:42:20: totalinches = ((63360 * miles) + (36 * yards) + (12 * feet) + (inches)) totalmeters = totalinches / 39.37 totalcentimeters = (totalmeters mod 1) * 1000) kilometers = Int(totalmeters / 1000) centimeters = Int(totalcentimeters / 1000) meters = Int((totalcentimeters mod 1) * 100) I've never programmed in VB before (only C,C++,Java), but the stuff you're trying to do is pretty universal, outside of syntax. Sadly, it took me more time than I anticipated to figure this (haven't tested it myself, though it should be correct *fingers crossed*), meaning I'm a bit rusty *sigh* Replys: Geez, I think I need to retake my programming classes :wall: Will (92gxe) 13:09:49 9/17/2004 (1) WOW, you rock. It came out to 73. I need to round it to one decimal place though, and that should be 73.5. Would I just take off the Int and do math.round(centimeters,1)? nm atulb84 (93 se) 14:33:33 9/17/2004 (0) Whoops, typo on previous post Will (92GXE) 12:45:53 9/17/2004 (0)

Name: |
E-Mail |
Car: |
Subject |
Message:
: totalinches = ((63360 * miles) + (36 * yards) + (12 * feet) + (inches)) : totalmeters = totalinches / 39.37 : totalcentimeters = (totalmeters mod 1) * 1000) : kilometers = Int(totalmeters / 1000) : centimeters = Int(totalcentimeters / 1000) : meters = Int((totalcentimeters mod 1) * 100) : I've never programmed in VB before (only C,C++,Java), but the stuff you're trying to do is pretty universal, outside of syntax. Sadly, it took me more time than I anticipated to figure this (haven't tested it myself, though it should be correct *fingers crossed*), meaning I'm a bit rusty *sigh*