Hi, part of my code has to calculate what percentage two numbers are of the whole (ie both the them). To do this, I used the same calculations which worked in school and worked in Delphi mere hours ago (I basically copied the code over). However, VB's percentages don't add up to 100.
The code:
The only time this has produced the right results is when the two numbers introVal and extroVal add up to 10 (I guess it's easier on VB that way
). Other times it either comes to around ~80-90% or ~105%, any thoughts on this?
The code:
Code:
total = introVal + extroVal
introValP = (introVal / total) * 100
extroValP = (extroVal / total) * 100
The only time this has produced the right results is when the two numbers introVal and extroVal add up to 10 (I guess it's easier on VB that way