Oct 22, 2008 #1 pwomack Technical User Apr 16, 2005 121 US Is there a method to call in vb2005 or vb2008 that will convert a fraction to a decimal or float? The user will enter a number with a fraction such as: 18 3/8 I then want to convert the value entered to: 18.375 Thanks.
Is there a method to call in vb2005 or vb2008 that will convert a fraction to a decimal or float? The user will enter a number with a fraction such as: 18 3/8 I then want to convert the value entered to: 18.375 Thanks.
Oct 22, 2008 #2 ousoonerjoe Programmer Jun 12, 2007 925 US Take the whole number and set it aside, then take the fraction and just Divide ( 3 / 8 = Decimal value) then add the two numbers together. "If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now. Upvote 0 Downvote
Take the whole number and set it aside, then take the fraction and just Divide ( 3 / 8 = Decimal value) then add the two numbers together. "If I were to wake up with my head sewn to the carpet, I wouldn't be more surprised than I am right now.
Oct 22, 2008 Thread starter #3 pwomack Technical User Apr 16, 2005 121 US Thanks. I thought of that, but I'm new to this and I had hoped there was an easier method. Upvote 0 Downvote
Oct 22, 2008 #4 DaveInIowa Programmer Dec 2, 2003 576 US There's no built-in method (in VB2005 at least), but you could build your own Fraction class. There are plenty of examples available. Upvote 0 Downvote
There's no built-in method (in VB2005 at least), but you could build your own Fraction class. There are plenty of examples available.