I just used the java Math library ceil function from PeopleCode to solve the “round to nearest 0.5” problem e.g.
1 2 3 4 5 6 7 8 9 10 11 | Local JavaObject &mathclass; Local number &number_to_round, &result; /* Instantiate java Math class */ &mathclass = GetJavaClass("java.lang.Math"); For &number_to_round = 0.1 To 2.0 Step 0.1 /* Use ceil function from java to solve problem */ &result = &mathclass.ceil(&number_to_round * 2) / 2; MessageBox(0, "", 0, 0, "Number to Round: " | &number_to_round | " Result: " | &result); End-For; |