divide two function

Stimulsoft Reports.NET discussion
Post Reply
nezarabd
Posts: 32
Joined: Tue Sep 30, 2014 1:38 pm

divide two function

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: divide two function

Post 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.
nezarabd
Posts: 32
Joined: Tue Sep 30, 2014 1:38 pm

Re: divide two function

Post by nezarabd »

not work also
it rounded for integer no
nezarabd
Posts: 32
Joined: Tue Sep 30, 2014 1:38 pm

Re: divide two function

Post by nezarabd »

i try simple like
{2/4}
show zero
when change text format to number also show 0.000
nezarabd
Posts: 32
Joined: Tue Sep 30, 2014 1:38 pm

Re: divide two function

Post by nezarabd »

when i change it to
{2/4.00}
it work
is there a way to change the "Count(DataBand1)" to decimal
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: divide two function

Post by HighAley »

Hello.

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

Code: Select all

(decimal)Count(DataBand1)
Thank you.
Post Reply