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
VB Code: variable = number / 2.54 If you're using it a lot, you might want to investigate using a function.
variable = number / 2.54
sorry didn't make myself clear I need the result to be insted of 2.25inches but 2 1/4 or 2¼.
I did a search and found this thread.
Tips, Examples & Tutorials: A valuable forum tool • Generate unique TreeView keys • TreeView with "open" and "closed folder" icons • Time code using GetTickCount • How to trap the Tab key • Scroll a form • NumberBox ActiveX control • Color a ListView row • An InputBox form • How to use SaveSetting and GetSetting • A program registration scheme • Spellcheck a Textbox • Resize controls • Open Windows Explorer at Last Visited Path • A Blackjack Game • Count lines of code • Private Message Viewer • Copy/Paste VB Code • Paste VB Code Add-In • Insert Procedure Names Add-In • A calculator for the game of Spider • My review of REALbasic 2008 • VB6 Debug Tutorial • Picture/Video Viewer • VBF Photo Contest Winners 2009 - 2016
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
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! 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
Private Sub Command1_Click() Dim Num As Long Dim Denom As Long DecToFrac Text1.Text, Num, Denom Text1.Text = Num & "/" & Denom End Sub
Forum Rules