Results 1 to 8 of 8

Thread: cm to inches.................

  1. #1

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    cm to inches.................

    Hard one here has anyone know how to convert cm to inches. I know how to multiply it by *2.54 but the answer I'm looking for is to give the end result of say 2½ or 2 1/2?


    thx
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  2. #2
    Lively Member
    Join Date
    May 2004
    Posts
    98
    VB Code:
    1. variable = number / 2.54

    If you're using it a lot, you might want to investigate using a function.

  3. #3

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    sorry didn't make myself clear I need the result to be insted of 2.25inches but 2 1/4 or 2¼.
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  4. #4

  5. #5

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542

    Red face

    thx Martin How would I use this to change the value in a TextBox?
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  6. #6

  7. #7

    Thread Starter
    Fanatic Member spud's Avatar
    Join Date
    Aug 2000
    Location
    Munster (Germany)
    Posts
    542
    Thx Martin for your time dont think my knowlage in this is up to it so I'll let the user work it out!


    Thx again
    Haven't got anything to say that is the least bit interesting.
    www.tartan-underground.com

  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    I reread your question and maybe this helps.

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3.     Dim Num As Long
    4.     Dim Denom As Long
    5.    
    6.     DecToFrac Text1.Text, Num, Denom
    7.    
    8.     Text1.Text = Num & "/" & Denom
    9. End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width