Page 1 of 1

divide two function

Posted: Tue May 05, 2015 7:55 pm
by nezarabd
thanks in advance

i have 2 function
- CountIf(DataBand1,DataSource1.sub1_s > subject_dgree_end.sub1s
- Count(DataBand1

work ok

i divide the two function with this

{Div(CountIf(DataBand1,DataSource1.sub1_s > subject_dgree_end.sub1s),Count(DataBand1))}

it get me integer value

how can i change to get me decimal value

i change the text format to number also not work

i search in the forum and i think it's because the type
how can i change the type of the function

Re: divide two function

Posted: Wed May 06, 2015 6:20 am
by HighAley
Hello.

The div method is an integer division method. It has no decimal part. If you need to get decimal values try to use next expression:

Code: Select all

{CountIf(DataBand1,DataSource1.sub1_s > subject_dgree_end.sub1s)/Count(DataBand1)}
Thank you.

Re: divide two function

Posted: Wed May 06, 2015 8:38 pm
by nezarabd
not work also
it rounded for integer no

Re: divide two function

Posted: Wed May 06, 2015 8:46 pm
by nezarabd
i try simple like
{2/4}
show zero
when change text format to number also show 0.000

Re: divide two function

Posted: Wed May 06, 2015 8:50 pm
by nezarabd
when i change it to
{2/4.00}
it work
is there a way to change the "Count(DataBand1)" to decimal

Re: divide two function

Posted: Thu May 07, 2015 5:21 am
by HighAley
Hello.

The Count function always returns Long type values.
You should use explicit conversion:

Code: Select all

(decimal)Count(DataBand1)
Thank you.