You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Bill Siggelkow <bi...@bellsouth.net> on 2004/09/13 22:50:37 UTC
Using a localized pattern with fmt:formatNumber
Is it possible to apply a localized pattern when using the
fmt:formatNumber tag?
In other words, I would like the following to work correctly if my
locale is some European locale like Russian:
Say,I have a Double with a value of "12345.34"
<fmt:formatNumber value="${dblValue}" pattern="# ##0,00"/>
This does not apply the pattern as a localized pattern ... it does work
correctly if the pattern is *not* localized as in:
<fmt:formatNumber value="${dblValue}" pattern="#,##0.00"/>
The reason I am asking is that the Struts bean:write tag supports
pulling the format String from a resource bundle; but the value is
treated as a localized pattern. I am trying to get equivalent behavior
with the fmt:formatNumber tag.
Let me know if I have not explained this adequately :)
- Bill Siggelkow
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Using a localized pattern with fmt:formatNumber
Posted by Big Chiz <bi...@gmail.com>.
i thought it would just be something like
<fmt:setLocale value="the intended local" />
<fmt:formatNumber value="${dblValue}" />
But i can be wrong... always... :)
On Mon, 13 Sep 2004 16:50:37 -0400, Bill Siggelkow
<bi...@bellsouth.net> wrote:
> Is it possible to apply a localized pattern when using the
> fmt:formatNumber tag?
>
> In other words, I would like the following to work correctly if my
> locale is some European locale like Russian:
>
> Say,I have a Double with a value of "12345.34"
>
> <fmt:formatNumber value="${dblValue}" pattern="# ##0,00"/>
>
> This does not apply the pattern as a localized pattern ... it does work
> correctly if the pattern is *not* localized as in:
>
> <fmt:formatNumber value="${dblValue}" pattern="#,##0.00"/>
>
> The reason I am asking is that the Struts bean:write tag supports
> pulling the format String from a resource bundle; but the value is
> treated as a localized pattern. I am trying to get equivalent behavior
> with the fmt:formatNumber tag.
>
> Let me know if I have not explained this adequately :)
>
> - Bill Siggelkow
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Using a localized pattern with fmt:formatNumber
Posted by Bill Siggelkow <bi...@bellsouth.net>.
Helios -- you're pretty much right. My reason is basically academic; let
me exlain -- The Struts bean:write tag applies the pattern as a
localized pattern if the pattern is retrieved using the formatKey
attribute. I was basically trying to find out if there was a way to
emulate this behavior in JSTL. In actuality, the Struts approach yields
a bug (27636) in that if the pattern is not defined in the resource
bundle than the pattern specified in the default bundle may very well
Helios Alonso wrote:
> Maybe you have to explain why you need to localize your pattern. I
> mean, can't you use a non-localized pattern even if you have one for
> each locale?
>
> At 16:50 13/09/2004 -0400, you wrote:
>
>> Is it possible to apply a localized pattern when using the
>> fmt:formatNumber tag?
>>
>> In other words, I would like the following to work correctly if my
>> locale is some European locale like Russian:
>>
>> Say,I have a Double with a value of "12345.34"
>>
>> <fmt:formatNumber value="${dblValue}" pattern="# ##0,00"/>
>>
>> This does not apply the pattern as a localized pattern ... it does
>> work correctly if the pattern is *not* localized as in:
>>
>> <fmt:formatNumber value="${dblValue}" pattern="#,##0.00"/>
>>
>> The reason I am asking is that the Struts bean:write tag supports
>> pulling the format String from a resource bundle; but the value is
>> treated as a localized pattern. I am trying to get equivalent behavior
>> with the fmt:formatNumber tag.
>>
>> Let me know if I have not explained this adequately :)
>>
>> - Bill Siggelkow
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Using a localized pattern with fmt:formatNumber
Posted by Helios Alonso <ha...@atg.com.uy>.
Maybe you have to explain why you need to localize your pattern. I mean,
can't you use a non-localized pattern even if you have one for each locale?
At 16:50 13/09/2004 -0400, you wrote:
>Is it possible to apply a localized pattern when using the
>fmt:formatNumber tag?
>
>In other words, I would like the following to work correctly if my locale
>is some European locale like Russian:
>
>Say,I have a Double with a value of "12345.34"
>
><fmt:formatNumber value="${dblValue}" pattern="# ##0,00"/>
>
>This does not apply the pattern as a localized pattern ... it does work
>correctly if the pattern is *not* localized as in:
>
><fmt:formatNumber value="${dblValue}" pattern="#,##0.00"/>
>
>The reason I am asking is that the Struts bean:write tag supports pulling
>the format String from a resource bundle; but the value is treated as a
>localized pattern. I am trying to get equivalent behavior with the
>fmt:formatNumber tag.
>
>Let me know if I have not explained this adequately :)
>
>- Bill Siggelkow
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org