on 06-16-2014 8:49 AM
Hi,
I have one report in that there is one custom function created called percentage when i run the report it give me error like division by zero. here is that function
Function (stringvar amount11,stringvar amount22)
stringvar amount1 := replace(replace(amount11,'.',''),',','');
stringvar amount2 := replace(replace(amount22,'.',''),',','');
if length(amount2) < 16 then
(
tonumber(amount1)*100/tonumber(amount2)
)
else
(
numbervar c:= length(amount2) - 15;
if length(amount1) > c then
(
stringvar amount3 := left(amount1,length(amount1)-c) + '.' + replace(replace(right(amount1,c),'.',''),',','');
tonumber(amount3)*100 /tonumber(left(amount2,15))
)
else
(
0
)
)
in RED highlighted area here i got that error. how i can resolve this one.
Kind Regards,
Ganesh
Hi Ganesh,
Change the formula in which the function is being called to:
stringvar amount22;
if amount22 = 0 then 0 else
Function (stringvar amount11,stringvar amount22);
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilash,
i follow as u told but i dosent got the correct output it shows all values to zero but there is some value is not zero then it also shows zero.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.