convert Hundredths of a Pound to oz - pounds.oz (vb.net-2008-windows form)

i need to convert Hundredths of a Pound to oz and oz to pounds.oz
anyone know how to do this in vb.net(2008) on a windows form please

i got this chart from a microwave manual if you can believe that. but i dont know enough about math to make a formula or know how in vb.net to do this

thank you in advance for any code or help you may provide


Ounces
0
1-2
3-4
5
6-7
8
9-10
11-12
13
14-15
Tenths of
a Pound
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
Hundredths of
a Pound
.96 - .05
.06 - .15
.16 - .25
.26 - .35
.36 - .45
.46 - .55
.56 - .65
.66 - .75
.76 - .85
.86 - .95
JohnnyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
Hi,
1 pound = 16 ounces

so based on this relation you can do everything you need.

oz = p * 16
p = oz / 16

ex: convert 5 pounds to ounces.
oz = 5 * 16
oz = 80     this means that 5 pounds equal 80 ounces.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RohitBagchiCommented:
Adding to AlexCode's correct formula, divide the result by 100 when you are working with hundredths of a pound, obviously.

If you are looking for the actual code, here is a link to get you going : http://www.dreamincode.net/forums/index.php?showtopic=121316

Cheers.
RB.
0
JohnnyAuthor Commented:
20 = 3.2 oz
(20/100) = 0.2
0.2*16 = 3.2 oz

if i read this right then it would be
            Try         ' read PackageDimensions.Weight
                Result_Box.AppendText("PackageDimensions.Weight: " & item.ItemAttributes.PackageDimensions.Weight.Value & vbCrLf)
                '20 = 3.2 oz | (20/100) = 0.2 | 0.2*16 = 3.2 oz
                Dim b_Weight As Integer = FormatNumber(CStr(CDbl(((item.ItemAttributes.PackageDimensions.Weight.Value) / 100) * 16)), 2)
                Result_Box.AppendText("PackageDimensions.Weight - OZ: " & b_Weight.ToString & vbCrLf)
            Catch ex As Exception
                textboxauth.Text = "Error reading PackageDimensions.Weight: " & ex.ToString()
            End Try

but its not doing 3.2 its returning 3
any ideas on how to fix please?


0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

CodeCruiserCommented:
Its being rounded to int instead of decimal.

Change this

Dim b_Weight As Integer

to

Dim b_Weight As Decimal
0
JohnnyAuthor Commented:
thank you all of you for the help
0
JohnnyAuthor Commented:
works now thank you all for the help
now to get the inches right now too for the dimensions (ugh yet another post/question)
0
JohnnyAuthor Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.