Menu

#3 Localization problem with float

open
nobody
None
6
2003-09-02
2003-06-19
No

The streaming doesn't respect the localization, i.e., a
number like 31,56 that uses a comma to separated the
decimals in some countries, differently from the
english 31.56 that uses a dot, confuses YAML while
loading the data back.

[dewd@localhost t_]$ ruby -e "require 'gtk2'; require
'yaml'; p 31.5"
31,5

[dewd@localhost t_]$ ruby -e "require 'gtk2'; require
'yaml'; p YAML::load(31.5.to_yaml)"
315

When gtk2 is required it changes the localization.

The country in particular is Brazil and the language is
portuguese.

Thanks,
Joao

Discussion

  • Why The Lucky Stiff

    • priority: 5 --> 6
     
  • Why The Lucky Stiff

    Logged In: YES
    user_id=114289

    What YAML is generated by...

    $ ruby -e "require 'gtk2'; require 'yaml'; y 31.5"

     

Log in to post a comment.

Monday.com Logo