This message was edited by the Moderator at 2002-4-1 16:52:55
I'm having difficulty with the Format function. I have created some code to figure the averages of a set of inputs. When I type my code, I want the numbers to be in the format "0.00" but if the average ends up being a whole number (integer), the code will not force it to be followed by .00. In other words, if I want to get 480.00, I am only getting 480 with no decimal point or zeros. Here is my code, please help if you can. Thanks!
'create a loop to display the averages _
'of each score (verbal, quantitative, _
'and analytical) for all entered students
Dim a As Integer
For a = 1 To UBound(fStudents)
VAverage = (VAverage + fStudents(a).VScore / StudentIndex)
QAverage = (QAverage + fStudents(a).QScore / StudentIndex)
AAverage = (AAverage + fStudents(a).AScore / StudentIndex)
'display averages in the format "0.00"
'round averages up to the next 1/100th (.00)
VAverage = Format(Round(VAverage, 2), "0.00")
QAverage = Format(Round(QAverage, 2), "0.00")
AAverage = Format(Round(AAverage, 2), "0.00")