/**
 * Licensed under the MICE s.r.l.
 * End User License Agreement
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.micegroup.it/voila/license.html
 */
package it.mice.voila.runtime.displaytag.basedec;

import java.math.BigDecimal;

/**
 * Display Column Decorator per la trasformazione dei campi valori con 2 cifre decimali. 
 */
public class Percentage2DecimalDecorator extends Value1DecimalDecorator {

    private static final BigDecimal BIG_DECIMAL_100 = new BigDecimal(100);

	public Percentage2DecimalDecorator() {
        super();
    }

    public String decorate(Object value) {
    	if (value == null) {
    		return "";
    	}
        return decorate(((BigDecimal)value).multiply(BIG_DECIMAL_100), getValueFromResource(CURRENCY_2DECIMAL_KEY)) + "%";
    }

}
