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


Groups > comp.lang.javascript > #17332

Re: how to remove trailing decimal or decimal 0 of a string?

Date 2012-11-22 14:07 +1100
From Andrew Poulos <ap_prog@hotmail.com>
Newsgroups comp.lang.javascript
Subject Re: how to remove trailing decimal or decimal 0 of a string?
References (1 earlier) <20121117112826.00530fe7@bootnic.server> <1788183.LAg6v8g3if@PointedEars.de> <pLrc5UI14oqQFwuP@invalid.uk.co.demon.merlyn.invalid> <1-ydnQHMtu9oVTfNnZ2dnUVZ_hednZ2d@westnet.com.au> <WCYDLEE+DSrQFwgP@invalid.uk.co.demon.merlyn.invalid>
Message-ID <xv-dnQ03dIVDCzDNnZ2dnUVZ_q-dnZ2d@westnet.com.au> (permalink)

Show all headers | View raw


On 22/11/2012 5:44 AM, Dr J R Stockton wrote:
> In comp.lang.javascript message <1-ydnQHMtu9oVTfNnZ2dnUVZ_hednZ2d@westne
> t.com.au>, Tue, 20 Nov 2012 11:03:55, Andrew Poulos
> <ap_prog@hotmail.com> posted:
>
>> On 20/11/2012 6:53 AM, Dr J R Stockton wrote:
>>> In comp.lang.javascript message <1788183.LAg6v8g3if@PointedEars.de>,
>>> Sun, 18 Nov 2012 01:56:31, Thomas 'PointedEars' Lahn
>>> <PointedEars@web.de> posted:
>>>
>>>> Number(myString) will return NaN if there are any non-digits and non-dots in
>>>> myString, ignoring leading whitespace.
>>>
>>> Trebly untrue, even disregarding the omissions of "decimal" and of
>>> trailing whitespace.
>>
>> On IE 9 at least, PE seems to be correct:
>>
>> var myString = "33a";
>> window.alert(Number(myString)); // alerts NaN
>>
>> myString = "3 3";
>> window.alert(Number(myString)); // alerts NaN
>>
>> myString = "33-";
>> window.alert(Number(myString)); // alerts NaN
>>
>> myString = "  33";
>> window.alert(Number(myString)); // alerts 33
>>
>> myString = "33  ";
>> window.alert(Number(myString)); // alerts 33
>
>
> You are merely proving that some non-digit non-dot characters will
> result in NaN, which is not the same thing.  To prove the quoted
> assertion, you need to consider all possible non-s in all possible
> places.  But to disprove an "any" statement, a single failure suffices.

I have no idea what you are talking about: whether its PE's assertion; 
my "proof" that PE was correct; your dislike of tinny audio; your 
dislike for PE... what?

Andrew Poulos

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how to remove trailing decimal or decimal 0 of a string? skrite <shawn@skrite.net> - 2012-11-16 09:12 -0800
  Re: how to remove trailing decimal or decimal 0 of a string? Andrew Poulos <ap_prog@hotmail.com> - 2012-11-17 07:10 +1100
    Re: how to remove trailing decimal or decimal 0 of a string? Andrew Poulos <ap_prog@hotmail.com> - 2012-11-17 13:51 +1100
    Re: how to remove trailing decimal or decimal 0 of a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-17 15:37 +0100
      Re: how to remove trailing decimal or decimal 0 of a string? Andrew Poulos <ap_prog@hotmail.com> - 2012-11-18 08:28 +1100
        Re: how to remove trailing decimal or decimal 0 of a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-18 01:02 +0100
          Re: how to remove trailing decimal or decimal 0 of a string? Andrew Poulos <ap_prog@hotmail.com> - 2012-11-18 15:40 +1100
  Re: how to remove trailing decimal or decimal 0 of a string? Denis McMahon <denismfmcmahon@gmail.com> - 2012-11-17 08:05 +0000
  Re: how to remove trailing decimal or decimal 0 of a string? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-17 09:24 +0100
    Re: how to remove trailing decimal or decimal 0 of a string? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-11-17 09:29 +0100
  Re: how to remove trailing decimal or decimal 0 of a string? Christoph Becker <cmbecker69@gmx.de> - 2012-11-17 12:04 +0100
  Re: how to remove trailing decimal or decimal 0 of a string? BootNic <bootnic.bounce@gmail.com> - 2012-11-17 11:28 -0500
    Re: how to remove trailing decimal or decimal 0 of a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-18 01:56 +0100
      Re: how to remove trailing decimal or decimal 0 of a string? Dr J R Stockton <reply1247@merlyn.demon.co.uk.invalid> - 2012-11-19 19:53 +0000
        Re: how to remove trailing decimal or decimal 0 of a string? Andrew Poulos <ap_prog@hotmail.com> - 2012-11-20 11:03 +1100
          Re: how to remove trailing decimal or decimal 0 of a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-20 01:50 +0100
          Re: how to remove trailing decimal or decimal 0 of a string? Dr J R Stockton <reply1247@merlyn.demon.co.uk.invalid> - 2012-11-21 18:44 +0000
            Re: how to remove trailing decimal or decimal 0 of a string? Andrew Poulos <ap_prog@hotmail.com> - 2012-11-22 14:07 +1100
        Re: how to remove trailing decimal or decimal 0 of a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-20 01:04 +0100
          Re: how to remove trailing decimal or decimal 0 of a string? Dr J R Stockton <reply1247@merlyn.demon.co.uk.invalid> - 2012-11-21 19:00 +0000
      Re: how to remove trailing decimal or decimal 0 of a string? Christoph Becker <cmbecker69@gmx.de> - 2012-11-20 02:10 +0100
        Re: how to remove trailing decimal or decimal 0 of a string? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-11-20 21:58 +0100
        Re: how to remove trailing decimal or decimal 0 of a string? Dr J R Stockton <reply1247@merlyn.demon.co.uk.invalid> - 2012-11-21 19:09 +0000
  Re: how to remove trailing decimal or decimal 0 of a string? Dr J R Stockton <reply1246@merlyn.demon.co.uk.invalid> - 2012-11-17 21:08 +0000

csiph-web