You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by tubin gen <fa...@gmail.com> on 2009/07/29 22:10:55 UTC
currency symbol in windows and unix different for a label model
I have a Label
new Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
? new BigDecimal(0): stgFinding.getFindingAmt()));
this works fine but when deployed in windows I get the label as
$0.00 and when deployed in unix i Get this as ¤0.00 and I also
get strange symbols Send Notification��
please help me resolve this.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: currency symbol in windows and unix different for a label model
Posted by Jonas <ba...@gmail.com>.
You shouldn't use methods that rely on the vm's default locale, as it
might be set
to something unexpected - use the methods with a locale parameter instead, and
pass the Session#getLocale in, e.g.
NumberFormat.getCurrencyInstance(Session.get().getLocale())
this is probably a serious amount of work, so if you only need to support one
locale, and the servlet container is under your control, just set its
default locale
using vm arguments like -Duser.country=us -Duser.language=en
setting the default locale from within a servlet (or wicket) will probably
fail if your servlet container runs with a security manager
On Thu, Jul 30, 2009 at 4:08 PM, fachhoch<fa...@gmail.com> wrote:
>
> I am assuming its some kind of java setting in unix box, I am a foreigner
> to unix please help me resolve this.
>
> fachhoch wrote:
>>
>> I have a Label
>>
>> new
>> Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
>> ? new BigDecimal(0): stgFinding.getFindingAmt()));
>>
>> this works fine but when deployed in windows I get the label as
>> $0.00 and when deployed in unix i Get this as ¤0.00 and I also
>> get strange symbols ��
>> please help me resolve this.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/currency-symbol-in-windows-and-unix-different-for-a-label-model-tp24726638p24739192.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: currency symbol in windows and unix different for a label model
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Your system default locale might be off. Always remember to initialize
it somewhere...
public static void resetLocale() {
TimeZone.setDefault(TimeZone.getTimeZone("EET"));
Locale.setDefault(new Locale("fi", "FI"));
}
// Joda time
DateTimeZone.setDefault(DateTimeZone.forTimeZone(TimeZone.getDefault()));
**
Martin
2009/7/30 fachhoch <fa...@gmail.com>:
>
> I am assuming its some kind of java setting in unix box, I am a foreigner
> to unix please help me resolve this.
>
> fachhoch wrote:
>>
>> I have a Label
>>
>> new
>> Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
>> ? new BigDecimal(0): stgFinding.getFindingAmt()));
>>
>> this works fine but when deployed in windows I get the label as
>> $0.00 and when deployed in unix i Get this as ¤0.00 and I also
>> get strange symbols ��
>> please help me resolve this.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/currency-symbol-in-windows-and-unix-different-for-a-label-model-tp24726638p24739192.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: currency symbol in windows and unix different for a label model
Posted by fachhoch <fa...@gmail.com>.
I am assuming its some kind of java setting in unix box, I am a foreigner
to unix please help me resolve this.
fachhoch wrote:
>
> I have a Label
>
> new
> Label("recommendedAmt",NumberFormat.getCurrencyInstance().format(stgFinding.getFindingAmt()==null
> ? new BigDecimal(0): stgFinding.getFindingAmt()));
>
> this works fine but when deployed in windows I get the label as
> $0.00 and when deployed in unix i Get this as ¤0.00 and I also
> get strange symbols ��
> please help me resolve this.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/currency-symbol-in-windows-and-unix-different-for-a-label-model-tp24726638p24739192.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org