On Mon, Jan 23, 2012 at 11:51 AM, Peter Vandenabeele
<peter / vandenabeele.com> wrote:
> On Mon, Jan 23, 2012 at 11:40 AM, Robert Klemme
> <shortcutter / googlemail.com>wrote:
>
>> On Mon, Jan 23, 2012 at 11:35 AM, Peter Vandenabeele
>> <peter / vandenabeele.com> wrote:
>> > On Mon, Jan 23, 2012 at 11:33 AM, Peter Vandenabeele <
>> peter / vandenabeele.com
>>
>> >> Feature request:
>> >>
>> >> Based on this discussion, it would actually be useful to me if I coul=
d
>> >> shorten this:
>> >>
>> >> =A0 amount =3D BigDecimal.new("15.5")
>> >>
>> >> to
>> >>
>> >> =A0 amount =3D 15.5B
>>
>> Bad idea IMHO because this requires a parser change and also makes all
>> programs implicitly require "bigdecimal" which is usually not needed.
>>
>> > Maybe
>> >
>> > 15.5D
>> >
>> > is better naming (maps to "Decimal" and the %d of format string).
>>
>> Or
>>
>> amount =3D 15.4.to_bd
>> amount =3D 15.4.to_decimal
>> amount =3D 15.4.to_dec
>> amount =3D BD(15.4)
>>
>
> When writing 15.4 ... and then calling a method on it,
> it's already too late.
>
> BD("15.4") would work though ...

Darn, right you and Josh are.  Well, then these methods should also be
defined on String.

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/