Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Locales

0 views
Skip to first unread message

Molitor, Stephen L

unread,
Apr 15, 2005, 3:46:54 PM4/15/05
to
Does anyone know of a good library for doing locale sensitive formatting
of numbers, money, and time? I.e.:

require 'locale.rb'

locale = Locale['fr_FRA']
french_format = 10000.99.to_s(locale)
#=> "10.000,99"

default_locale_format = 10000.99.to_s
#=> "10,000.99"

Thanks!

Steve


Austin Ziegler

unread,
Apr 15, 2005, 7:08:25 PM4/15/05
to

Not that I know of. I know that the number formatting method I wrote
many months ago and Gavin Sinclair included in his Extensions library
does some locale-like formatting and is more configurable.

It would be a good basis for a localization module if you want to use
it, as well.

-austin
--
Austin Ziegler * halos...@gmail.com
* Alternate: aus...@halostatue.ca

Bertram Scharpf

unread,
Apr 15, 2005, 10:06:02 PM4/15/05
to
Hi,

Fixnum#to_s already has a parameter defined, the base:

15.to_s 16 #=> f

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de


0 new messages