From: ts Date: 2001-08-30T15:40:11+09:00 Subject: [ruby-talk:20566] Re: Problem with float numbers >>>>> "Y" == Yukihiro Matsumoto writes: Y> Hi, Y> In message "[ruby-talk:20531] Re: Problem with float numbers" Y> on 01/08/29, Erik B�gfors writes: Y> |I think you are correct Y> |#[Wed Aug 29 16:36:38]:~ Y> |: [bagfors@detrius]$ ; LC_ALL=sv_SE ruby test.rb Y> |5,2.0 Y> |but where does the extra .0 come from??? Y> I don't know. Maybe a bug in Ruby. I hope not. It came from here (flo_to_s). rb_f_puts is called will a Float and sprintf("%-.10g") return "5,2" 222 if (strchr(s, '.') == 0) { 223 int len = strlen(buf); 224 char *ind = strchr(buf, 'e'); 225 226 if (ind) { 227 memmove(ind+2, ind, len-(ind-buf)+1); 228 ind[0] = '.'; 229 ind[1] = '0'; 230 } else { 231 strcat(buf, ".0"); 232 } 233 } s contains "5,2" in this case Guy Decoux