// BlackBerry(BB) browsers cannot handle width if it is expressed in
// percentage and the percentage value contains a decimal points like
// 40.0%. So lets truncate the percentage value from the decimal point
// for BB browsers. Example, instead of 40.0%, lets render 40%.
RenderingContext arc = RenderingContext.getCurrentInstance();
Agent agent = arc.getAgent();
boolean isBlackBerry =
Agent.AGENT_BLACKBERRY.equals(agent.getAgentName());
// Now normalize the percentages (including the footer label width):
double ratioTotal = (labelRatio + fieldRatio) / 100;
double effectiveLabelWidthDouble = labelRatio / ratioTotal;
double footerLabel = effectiveLabelWidthDouble / actualColumns;