Welcome, Guest. Please login or register.
Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - showmesky

Pages: [1]
1
Discussion | Обсуждение / Re: Number Display form problem?
« on: August 31, 2021, 10:47:36 AM »
ok,I have to create wheels for my self.

for achieving the function ,I use the script to finish it(different from old version too),anyone can give me a introduction ?

Code: [Select]
function Pow(base,exp){


if(exp == 0){

return 1;
}else{

var result = 1;
for(i=0;i<exp;i++){

result=result*10;

}
return result;
}


}

function dig_jud(value){

if(value<10&&value>=0){
return true;
}

if(value>=10){
return false;
}

}

function sc_nota(value,percision){

// to make scientific notation
var result;
var digit;
var count=0;
result = value;
var srs;
if(value>=1){


while(result>1)
{
result=result/10;
count++;
}
var exp=count-1;
var temp = Pow(10,exp);
result = value/temp;
digit = count-1;
if(dig_jud(digit)){
srs = numberFormat(result,'f',percision)+"E+0"+digit;

}else{


srs = numberFormat(result,'f',percision)+"E+"+digit;
}
 
return srs;

}
if(value<1&&value>0){

while(result<1){

result=result*10;
count++;

}
digit=count;
var temp1 = Pow(10, count);
result = value*temp1
if(dig_jud(digit)){
srs = numberFormat(result,'f',percision)+"E-0"+digit;

}else{


srs = numberFormat(result,'f',percision)+"E-"+digit;
}
return srs;

}

if(value<0){

return "NULL"

}
}

seems work fine


2
Discussion | Обсуждение / Number Display form problem?
« on: August 30, 2021, 02:49:29 PM »
Hi, I have a problem about display form. :)

I want to display the number like this:

value1=234567.0

if in QT, I will use the function to finish it

QString::number(value1,'e',4);

the result is 2.3457e+05(scientific notation)!!!!

in limereport version 1.4.7, I get the right result with numberformat, but I get a different result in new version (1.5.0)

numberformat($D{all.3},"E",5,"en-En")

can anyone help me? thanks

3
Ok!Your method works.  :) Thank you very much

I also agree with your opinion of math AVG 8)


4
I know the function AVG.
I used it like that: AVG($D{data....}.
If it worked well like this: (1+2+3+4+5)/5=3,that's what I want.
but sometimes ,the data is like :0,0,0,0,5,so the function will get the result of (0+...+5)/5=1,this is not the correct result I wanted, the correct result is 5/1=5.
Anyone get good idea? thanks very much.

5
Discussion | Обсуждение / Re: to get Average value
« on: September 04, 2018, 09:53:48 AM »
I have solve it.

6
Discussion | Обсуждение / to get Average value
« on: September 04, 2018, 03:01:14 AM »
Hello,everyone!
I have a question about function AVG,my report structure like this
table1.column1,         table2.column,         function1(table1.column,table2.column,para3)
AVG(table1.column1),    AVG(table.column2),    AVG(???);
the column1,2 data is from datasource, column3 is calculated by a function with parameter,now I want to Get the average value of column,how can I write the script,or is it possible to use the default function AVG to do it ?
thanks!

Pages: [1]