Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35904 > unrolled thread

Re: "Double.toString"

Started byArne Vajhøj <arne@vajhoej.dk>
First post2016-11-19 14:49 -0500
Last post2016-11-20 09:08 -0500
Articles 2 — 1 participant

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: "Double.toString" Arne Vajhøj <arne@vajhoej.dk> - 2016-11-19 14:49 -0500
    Re: "Double.toString" Arne Vajhøj <arne@vajhoej.dk> - 2016-11-20 09:08 -0500

#35904 — Re: "Double.toString"

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-11-19 14:49 -0500
SubjectRe: "Double.toString"
Message-ID<o0qabv$19gb$1@gioia.aioe.org>
On 11/19/2016 10:53 AM, Stefan Ram wrote:
>   When a course participant used the static method
>   »Double.toString«, I said it won't work this way,
>   because there is no such static method.
>
>   Turned out, a static »toString« method sits there
>   fat and happy on the documentation page of the class
>   »java.lang.Double«. And it does not even seem to be
>   new (no »since 1.8« or some such).
>
>   How could I have missed this method all those years?
>   Or did I know it once and my memory failed on me?
>
>   Have you been aware of this static toString method?
>   Is it a "well-known", prominent method to you?

I am always expecting the wrapper classes to have:

.toString()
.parseXxxx(s)

Arne

[toc] | [next] | [standalone]


#35908

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-11-20 09:08 -0500
Message-ID<o0sao3$1siv$1@gioia.aioe.org>
In reply to#35904
On 11/19/2016 2:49 PM, Arne Vajhøj wrote:
> On 11/19/2016 10:53 AM, Stefan Ram wrote:
>>   When a course participant used the static method
>>   »Double.toString«, I said it won't work this way,
>>   because there is no such static method.
>>
>>   Turned out, a static »toString« method sits there
>>   fat and happy on the documentation page of the class
>>   »java.lang.Double«. And it does not even seem to be
>>   new (no »since 1.8« or some such).
>>
>>   How could I have missed this method all those years?
>>   Or did I know it once and my memory failed on me?
>>
>>   Have you been aware of this static toString method?
>>   Is it a "well-known", prominent method to you?
>
> I am always expecting the wrapper classes to have:
>
> .toString()
> .parseXxxx(s)

I would add that Double.toString is sort of a quick an dirty
method.

For most serious usage Decimal.format is preferred due
to the better control over output.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web