You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lucas Gonzalez <lu...@convergia.com.ar> on 2004/02/05 15:55:18 UTC

Formating a float

Hi,
I´ve been searching the list for any insight about this issue, but found no
real solutions.

I need to format a float that is shown using:

    <bean:write name="netTotal" filter="true" format="#,###.00"/>

but it does not works.
I´ve tried with many formats, but none seems to work. There is anything I am
doing wrong?

I wonder if anyone could point me some docs or anything that might help....
=)

Thanks a lot!
Lucas


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Formating a float

Posted by Mark Lowe <ma...@talk21.com>.
I think the JSTL suggestion was perhaps worth listening to.


On 5 Feb 2004, at 17:06, Guillermo Meyer wrote:

> Lucas:
> Inspecting WriteTag.java code i found this:
>
>      */
>     protected String formatValue(Object valueToFormat) throws
> JspException {
>         Format format = null;
>         Object value = valueToFormat;
>         Locale locale =
>             RequestUtils.retrieveUserLocale( pageContext, 
> this.localeKey
> );
>         boolean formatStrFromResources = false;
>         String formatString = formatStr;
>
>         // Return String object as is.
>         if ( value instanceof java.lang.String ) {
>                 return (String)value;
>         } else {
> ...............
> ...............
> Do formatting stuff
> ...............
> ...............
>
> May you have netTotal as a String object?
>
> -----Original Message-----
> From: Lucas Gonzalez [mailto:lucas.gonzalez@convergia.com.ar]
> Sent: Jueves, 05 de Febrero de 2004 11:55 a.m.
> To: Struts Users Mailing List
> Subject: Formating a float
>
>
> Hi,
> I´ve been searching the list for any insight about this issue, but 
> found
> no real solutions.
>
> I need to format a float that is shown using:
>
>     <bean:write name="netTotal" filter="true" format="#,###.00"/>
>
> but it does not works.
> I´ve tried with many formats, but none seems to work. There is anything
> I am doing wrong?
>
> I wonder if anyone could point me some docs or anything that might
> help....
> =)
>
> Thanks a lot!
> Lucas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> NOTA DE CONFIDENCIALIDAD
> Este mensaje (y sus anexos) es confidencial, esta dirigido 
> exclusivamente a las personas direccionadas en el mail y puede 
> contener informacion (i)de propiedad exclusiva de Interbanking S.A. o 
> (ii) amparada por el secreto profesional. Cualquier opinion en el 
> contenido, es exclusiva de su autor y no representa necesariamente la 
> opinion de Interbanking S.A. El acceso no autorizado, uso, 
> reproduccion, o divulgacion esta prohibido. Interbanking S.A no 
> asumira responsabilidad ni obligacion legal alguna por cualquier 
> informacion incorrecta o alterada contenida en este mensaje. Si usted 
> ha recibido este mensaje por error, le rogamos tenga la amabilidad de 
> destruirlo inmediatamente junto con todas las copias del mismo, 
> notificando al remitente. No debera utilizar, revelar, distribuir, 
> imprimir o copiar este mensaje ni ninguna de sus partes si usted no es 
> el destinatario. Muchas gracias.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Formating a float

Posted by Guillermo Meyer <gm...@interbanking.com.ar>.
Lucas:
Inspecting WriteTag.java code i found this:

     */
    protected String formatValue(Object valueToFormat) throws
JspException {
        Format format = null;
        Object value = valueToFormat;
        Locale locale =
            RequestUtils.retrieveUserLocale( pageContext, this.localeKey
);
        boolean formatStrFromResources = false;
        String formatString = formatStr;

        // Return String object as is.
        if ( value instanceof java.lang.String ) {
                return (String)value;
        } else {
...............
...............
Do formatting stuff
...............
...............

May you have netTotal as a String object?

-----Original Message-----
From: Lucas Gonzalez [mailto:lucas.gonzalez@convergia.com.ar] 
Sent: Jueves, 05 de Febrero de 2004 11:55 a.m.
To: Struts Users Mailing List
Subject: Formating a float


Hi,
I´ve been searching the list for any insight about this issue, but found
no real solutions.

I need to format a float that is shown using:

    <bean:write name="netTotal" filter="true" format="#,###.00"/>

but it does not works.
I´ve tried with many formats, but none seems to work. There is anything
I am doing wrong?

I wonder if anyone could point me some docs or anything that might
help....
=)

Thanks a lot!
Lucas


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org