Hi All,
I am using the Runtime Converter to convert decimal/architectural values, but I am stumped on how to convert a value to an all inch value.
I need a value such as 99.5 to convert to a string value of 99 1/2", but am not having any luck. If I use DistanceUnitFormat.Architectural, it returns 8'-3 1/2".
I am sure I can achieve what I want by splitting the string out and adding the various parts, but I want to avoid the drain bamage of doing so if there is an easier way.
Any ideas how I can convert to an all inch format?
Thanks!
Solved! Go to Solution.
Solved by Mike.Wohletz. Go to Solution.
Take a look at this: http://www.vbforums.com/showthread.php?p=3917017
You can call it something like I have shown below and get what you are looking for, there is probably a better way to get this but this worked on the first try so that is what I am sending.
Dim intSize As Double = 99.5 Dim intDecimal As Double = CType(intSize.ToString.Substring(intSize.ToString.IndexOf(".")), Double) Dim intHole As Double = intSize - intDecimal MsgBox(intHole & " " & dec2frac(intDecimal) & Chr(34))