Here you can find the source of printGainHTML(BigDecimal gain)
public static String printGainHTML(BigDecimal gain)
//package com.java2s; // All Rights Reserved * Licensed Materials - Property of IBM import java.math.BigDecimal; public class Main { public final static int ROUND = BigDecimal.ROUND_HALF_UP; public final static int SCALE = 2; public static String printGainHTML(BigDecimal gain) { String htmlString, arrow; if (gain.doubleValue() < 0.0) { htmlString = "<FONT color=\"#ff0000\">"; arrow = "arrowdown.gif"; } else {//from ww w.j a v a 2 s.c om htmlString = "<FONT color=\"#009900\">"; arrow = "arrowup.gif"; } htmlString += gain.setScale(SCALE, ROUND) + "</FONT><IMG src=\"images/" + arrow + "\" width=\"10\" height=\"10\" border=\"0\"></IMG>"; return htmlString; } }