Km to MPH conversion - what am I doing wrong?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?


    Thank you for that revelation. What do you think the result of (1006/1619) is?
    You don't have to be a smart ass. Why don't you just multiply you km value by 6213/1000? it seems easy to me. maybe I am missing something.
    Regards
    CharlieM
    Using PBP3
    MCSPX

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?

    You don't have to be a smart ass.
    I made my comment because of yours:
    doing a google search I have found that 1 kmh is equal to .6213 mph.
    It's as if you said, "I spent 30 seconds on Google and found out that 1 kmh is equal to .6213. You couldn't have tried to research this problem at all."

    In response to your current question, of
    Why don't you just multiply you km value by 6213/1000? it seems easy to me. maybe I am missing something.
    Yes, you are missing something. Did you read my first post?

    I can do it the other way where it's 6.21.....Then if the speed is over 65 MPH, it rolls over due to a word sized variable.
    Did you ever try to do 98 X 256 X 6.213 on an 18F4550?

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?

    what is the range of the km and mp you need?

    If up to 105 Km is OK with you then a word size variable can do it I think.

    105(km)*621=65205. Scaling by 100 gives 65.205 Miles.

    Or 65205/621 gives back Km. Also if the Miles are scaled up by a factor of 100.

    Ioannis

  4. #4
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?

    Mackrackit's solution may work. I hope to try it today.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?

    Didn't you need the reverse?

    Ioannis

  6. #6
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?

    Quote Originally Posted by Ioannis View Post
    Didn't you need the reverse?

    Ioannis
    No.

    miles = km */ 159

    Should work.
    Like a champ! It's .13 MPH off at 100 MPH and .09 MPH off at 1 MPH. I'm guessing because of the additional numbers needed for a true KM to MPH conversion? Who cares, I don't need it to be that accurate anyway. Thanks again for the help!

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Km to MPH conversion - what am I doing wrong?

    Hi,
    You said you don't need it but you could try miles=km**40718, it should get you a little bit closer still.

    /Henrik.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts