[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>

Dear Ruby developers and users!

8 messages 2009/04/17

[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>

Feature #1408: 0.1.to_r not equal to (1/10)

19 messages 2009/04/26

[ruby-core:23182] Re: [Bug #1336] Change in string representation of Floats

From: Brent Roman <brent@...>
Date: 2009-04-11 18:59:26 UTC
List: ruby-core #23182
Your latter example seems quite nice.
Especially if it would accept unabbreviated forms such as this:

0.9.to_s(precision: 4, width: 6) #=> " 9.000"

- brent



Nobuyoshi Nakada-2 wrote:
> 
> Hi,
> 
> At Sat, 11 Apr 2009 15:17:24 +0900,
> Roger Pack wrote in [ruby-core:23179]:
>> Is this satisfactory, or would anyone still prefer Float#to_s
>> => rounded, Float#inspect => non rounded (i.e. 0.9.inspect =>
>> "0.8999999999")?  Just wondering since I brought up this mess
>> :)
> 
> I had another thought, Float#to_s could take an optional
> argument to specify the precision or the format.
> 
> e.g.:
> 
>   0.9.to_s(3)   #=> "0.900"
>   0.9.to_s("e") #=> "9.000000e-01"
>   0.9.to_s(prec: 4, width: 6) #=> " 9.000"
> 
> -- 
> Nobu Nakada
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-ruby-core%3A23075---Bug--1336--Change-in-string-representation-of-Floats-tp22798535p23004340.html
Sent from the ruby-core mailing list archive at Nabble.com.


In This Thread