[mochikit] Re: Does Mochikit accept patches for Format.LOCALE ?

2007-05-16 Thread Bob Ippolito

On 5/16/07, Roger Demetrescu [EMAIL PROTECTED] wrote:

 If it is possible, could you guys add this brazilian-portuguese locale
 to MochiKit.Format.LOCALE ?



 ...
 pt_BR: {separator: ., decimal: ,, percent: %},
 ...

Ok, it's in r1292.

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: Does Mochikit accept patches for Format.LOCALE ?

2007-05-16 Thread Roger Demetrescu

Thanks Bob...  :)

I've just noticied that my first reply went to you, and not to the ML...
I'm replying to ML, as reference for other people



On 5/16/07, Bob Ippolito [EMAIL PROTECTED] wrote:
 There is no function for doing that in MochiKit... but it's easy to write one:

 parseLocaleFloat = function(locale, str) {
 locale = MochiKit.Format.formatLocale(locale);
 return parseFloat(str.replace(locale.separator,
 ).replace(locale.decimal, .));
 }

  parseLocaleFloat(pt_BR, 123.456,78)
 123456.78

 -bob

 On 5/16/07, Roger Demetrescu [EMAIL PROTECTED] wrote:
  Thanks, Bob...  :)
 
 
  BTW, is it possible to convert a string into number using the rules
  from Mochikit.Format (and a chosen locale) ?
 
  eg. with pt_BR locale, I would like to convert 123.456,78 in the
  number 123456.78  .
 
 
  Thanks again,
 
  Roger
 
 
 
  On 5/16/07, Bob Ippolito [EMAIL PROTECTED] wrote:
   On 5/16/07, Roger Demetrescu [EMAIL PROTECTED] wrote:
   
If it is possible, could you guys add this brazilian-portuguese locale
to MochiKit.Format.LOCALE ?
   
   
   
...
pt_BR: {separator: ., decimal: ,, percent: %},
...
  
   Ok, it's in r1292.
  
   -bob
  
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---