For display and data entry purposes I need those fields to be a whole percent. To do so, I have created a new field (wk_Percent1 and wk_Percent2) both of which are int(4).
I calculate the percentage using wk_Percent1 = BPU1 * 100 so that .140000 becomes 14. Nothing extraordinary here.
I am experiencing 2 issues.
- I want to display the wk_Percent fields with the percent sign. I tried using an edit word with ' %' but that pushes the value over to the right, which I don't want, it want it displayed simply as 14% not ' 14%' (note the spaces before the 14)
- When converting a decimal that is greater than 1, I am getting rounding errors. So that 1.140000 * 100 is showing 113 whereas is should be 114.
Code: Select all
evtroutine handling(#Get.Completed)
if (#wk_Status = "OK")
#CurrentBPU1 := #BPU1
#CurrentBPU2 := #BPU2
#wk_Percent1 := #BPU1 * 100
#wk_Percent2 := #BPU2 * 100
endif
endroutine
What am I doing wrong?
Joe