Package org.gwtoolbox.commons.types.client

Examples of org.gwtoolbox.commons.types.client.Money


    public Class[] getSupportedTypes() {
        return new Class[] { Money.class };
    }

    public String toText(Object value) {
        Money money = (Money) value;
        StringBuilder builder = new StringBuilder()
                .append(format.format(money.getUnitPart()))
                .append(decimalSeparator)
                .append(padCents(money.getCentPart()))
                .append(" ")
                .append(money.getCurrency().getCurrencyCode());

        return builder.toString();
    }
View Full Code Here


        return builder.toString();
    }

    public String toHTML(Object value) {
        Money money = (Money) value;
        StringBuilder builder = new StringBuilder()
                .append(money.getCurrency().getHtmlSymbol())
                .append(" ")
                .append(format.format(money.getUnitPart()))
                .append(decimalSeparator)
                .append(padCents(money.getCentPart()));

        return builder.toString();
    }
View Full Code Here

TOP

Related Classes of org.gwtoolbox.commons.types.client.Money

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.