You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tomáš Drenčák <to...@gmail.com> on 2005/09/27 22:07:39 UTC

Floating Number "delocalization"

Hi!
I have following problem. In slovak language we have "," (floating
comma) as decimal separator, in english there's "." (floating point)
as decimal separator. But it's common practise that everybody use "."
as decimal separator in slovak. How can I change this separator to "."
even I have slovak locale?   I need this to work with tranlator prefix
(in TextField component translator binding)? Is it necessary to
override something and set in hivemodule or just set contribution in
hivemodule?

Thanks
        tomas

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


Re: Floating Number "delocalization"

Posted by Didier LAFFORGUE <di...@capgemini.com>.
Hi Tomas,

If my understanding of your problem is right (I had the same problem a week ago), the solution is:

 DecimalFormatSymbols symbols = new DecimalFormatSymbols();
  symbols.setDecimalSeparator('.');
  NumberFormat priceFormat = new DecimalFormat("########0.00", symbols);
  priceFormat.setMinimumFractionDigits(2);

       
        Did


----- Original Message -----
From: "Tomáš Drenčák" <to...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, September 29, 2005 11:07 PM
Subject: Re: Floating Number "delocalization"


> Not sure, but "." in pattern means localized decimal separator (e.g.".", ","). So if you define \. you have just char "." not separator inpattern and therefore number is translated as integer...
> I have tried this in component annotation (###\.###) and it's justshowing \ in the number string... Maybe doing something wrong... :(
> 2005/9/29, Kent Tong <ke...@cpttm.org.mo>:> Tomáš Drenčák <tomas.drencak <at> gmail.com> writes:>> > I have following problem. In slovak language we have "," (floating> > comma) as decimal separator, in english there's "." (floating point)> > as decimal separator. But it's common practise that everybody use "."> > as decimal separator in slovak. How can I change this separator to "."> > even I have slovak locale?   I need this to work with tranlator prefix> > (in TextField component translator binding)?>> Have you tried:>>  <binding name="translator" value="translator:number,pattern=#\.0"/>>> --> Author of a book for learning Tapestry (www.agileskills2.org/EWDT)>>> ---------------------------------------------------------------------> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org>>

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.


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


Re: Floating Number "delocalization"

Posted by Tomáš Drenčák <to...@gmail.com>.
Not sure, but "." in pattern means localized decimal separator (e.g.
".", ","). So if you define \. you have just char "." not separator in
pattern and therefore number is translated as integer...

I have tried this in component annotation (###\.###) and it's just
showing \ in the number string... Maybe doing something wrong... :(

2005/9/29, Kent Tong <ke...@cpttm.org.mo>:
> Tomáš Drenčák <tomas.drencak <at> gmail.com> writes:
>
> > I have following problem. In slovak language we have "," (floating
> > comma) as decimal separator, in english there's "." (floating point)
> > as decimal separator. But it's common practise that everybody use "."
> > as decimal separator in slovak. How can I change this separator to "."
> > even I have slovak locale?   I need this to work with tranlator prefix
> > (in TextField component translator binding)?
>
> Have you tried:
>
>  <binding name="translator" value="translator:number,pattern=#\.0"/>
>
> --
> Author of a book for learning Tapestry (www.agileskills2.org/EWDT)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

Re: Floating Number "delocalization"

Posted by Kent Tong <ke...@cpttm.org.mo>.
Tomáš Drenčák <tomas.drencak <at> gmail.com> writes:

> I have following problem. In slovak language we have "," (floating
> comma) as decimal separator, in english there's "." (floating point)
> as decimal separator. But it's common practise that everybody use "."
> as decimal separator in slovak. How can I change this separator to "."
> even I have slovak locale?   I need this to work with tranlator prefix
> (in TextField component translator binding)? 

Have you tried:

 <binding name="translator" value="translator:number,pattern=#\.0"/>

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)


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


Re: Floating Number "delocalization"

Posted by Marcus Brito <mb...@gmail.com>.
Patrick Casey <patcasey <at> adelphia.net> writes:

> 	Could you use a custom number pattern formatter? 

It wouldn't help. The "." in a format pattern means "decimal separator", and the
actual character used will vary depending on the locale. For example, the format
"#0.00" applied to 10.3 with a pt_BR locale would format to 01,30.

-- Marcus Brito


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


RE: Floating Number "delocalization"

Posted by Patrick Casey <pa...@adelphia.net>.
	Could you use a custom number pattern formatter? 

	--- Pat

> -----Original Message-----
> From: Tomáš Drenčák [mailto:tomas.drencak@gmail.com]
> Sent: Tuesday, September 27, 2005 1:08 PM
> To: Tapestry users
> Subject: Floating Number "delocalization"
> 
> Hi!
> I have following problem. In slovak language we have "," (floating
> comma) as decimal separator, in english there's "." (floating point)
> as decimal separator. But it's common practise that everybody use "."
> as decimal separator in slovak. How can I change this separator to "."
> even I have slovak locale?   I need this to work with tranlator prefix
> (in TextField component translator binding)? Is it necessary to
> override something and set in hivemodule or just set contribution in
> hivemodule?
> 
> Thanks
>         tomas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




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