IF-Else formula [message #644138] |
Thu, 09 December 2010 16:22 |
bapo Messages: 1 Registered: December 2010 |
Junior Member |
|
|
Hello, I am new to Birt, and need some help.
I have a problem with IF-Else formula. At the momement I use this formula...
a=value (minutes)
if (a == 0) {
s = "00:00h"
} else {
s="";
partoftheday = parseInt(a/480,0);
if (partoftheday != 0) {
s+=partoftheday;
loc = reportContext.getLocale();
if (BirtComp.like(loc, "de_%"))
s+="d ";
else
s+="a ";
}
if (a<0 && partoftheday != 0)
rest =-1 * a % 480;
else
rest = a % 480;
if (rest > 0) {
s+="0"+parseInt(rest/60,0);
if((rest%60)<10)
s+=":0"+(rest%60)+"h";
else
s+=":"+(rest%60)+"h";
} else if (rest < 0) {
s+="-0"+parseInt(-1*rest/60,0);
if((-1*rest%60)<10)
s+=":0"+(-1*rest%60)+"h";
else
s+=":"+(-1*rest%60)+"h";
} else if (rest == 0){
s += "00:00h";
} else {
s += "XX:XXh"
}
}
to get this format "Xd XX:XXh".
And now I want to get this format "XX:XXh". Until now, the requirements were always to convert the hours to days. This meant that a working day (8 hours) resulted in a day and the rest was displayed in hours and minutes. Now it is so that only the hours and minutes should to be displayed
but I don´t know what I have to do.
Maybe someone who can help me.
Thanks in advance.
bapo
[Updated on: Thu, 09 December 2010 16:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03115 seconds