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:confused:
Printable View
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:confused:
VB Code:
variable = number / 2.54
If you're using it a lot, you might want to investigate using a function.
sorry didn't make myself clear I need the result to be insted of 2.25inches but 2 1/4 or 2¼.:blush:
I did a search and found this thread.
thx Martin How would I use this to change the value in a TextBox?
I suppose like this:
VB Code:
Private Sub Command1_Click() Dim Num As Long Dim Denom As Long DecToFrac 0.125, Num, Denom Text1.Text = Num & "/" & Denom End Sub
Thx Martin for your time dont think my knowlage in this is up to it so I'll let the user work it out!:ehh:
Thx again
I reread your question and maybe this helps.
VB Code:
Private Sub Command1_Click() Dim Num As Long Dim Denom As Long DecToFrac Text1.Text, Num, Denom Text1.Text = Num & "/" & Denom End Sub