Forum: Ruby Numeric locale

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bertram S. (Guest)
on 2007-06-04 16:45
(Received via mailing list)
Hi,

the German decimal separator is ",". So pi will be
represented by "3,1415" rather than "3.1415". As far as I
know this behaviour is controlled by the LC_NUMERIC
environment variable.

Now, I notice the following on my system: When I'm in editor
Vim I may say in command mode:

  :ruby puts 4.56
  :!ruby -e 'puts 4.56'

The former is the built-in ruby interface, the latter a call
to a child process and will show thats standard output.

But I happen to encounter two different results. The
built-in version gives "4,56"; the child process prints
"4.56".

How can I make the normal Ruby process print a comma, too?

Thanks in advance

Bertram
Yukihiro M. (Guest)
on 2007-06-04 18:49
(Received via mailing list)
Hi,

In message "Re: Numeric locale"
    on Mon, 4 Jun 2007 21:39:26 +0900, Bertram S.
<removed_email_address@domain.invalid> writes:

|How can I make the normal Ruby process print a comma, too?

I'm sorry but LC_NUMERIC is disabled at the current level of
implementation, since it causes more headache than merit, e.g. causing
marshal incompatibility, syntax error, etc.  We will support it in the
future.  But not in specific near future.

              matz.
Bertram S. (Guest)
on 2007-06-04 20:07
(Received via mailing list)
Hi,

Am Montag, 04. Jun 2007, 23:48:25 +0900 schrieb Yukihiro M.:
> In message "Re: Numeric locale"
>     on Mon, 4 Jun 2007 21:39:26 +0900, Bertram S. <removed_email_address@domain.invalid> 
writes:
>
> |How can I make the normal Ruby process print a comma, too?
>
> I'm sorry but LC_NUMERIC is disabled at the current level of
> implementation, since it causes more headache than merit,
> [...]

Then the Vim behaviour probably is the bug. Thanks anyway;
now I know about it.

Bertram
This topic is locked and can not be replied to.