3 Replies Latest reply on Oct 13, 2006 12:31 AM by Newsgroup_User

    nodeValue  and a NaN problem

    Level 7
      hi,

      i take a value from XML like this :
      var num:Number= Number(votes.childNodes
      .childNodes[1].firstChild.nodeValue

      in XML value is(xml file is below) : 21,22

      but, num variable is become NaN?? if I dont use Number, there is no
      problem, i took 21,22, but when I multiple it with a number or Convert it to
      Number(like above) result is NaN?

      why?
      <?xml version='1.0' encoding='UTF-8'?>
      <results>
      <vote>
      <id>1</id>
      <name>text</name>
      <count>10</count>
      <percentage>21,22</percentage>
      </vote>
      </results>

      regards,
      Burak


        • 1. Re: nodeValue  and a NaN problem
          Level 7
          I changed my regional settings to test this, and it looks like there's no
          support for international number formats -- and there's no indication it
          will change with AS3.

          So you'll need to parse your string data and replace the separators before
          you can convert the string data.

          21,22 would need to become 21.22

          1 222,23 would need to become 1,222.23

          etc...


          • 2. Re: nodeValue  and a NaN problem
            Level 7
            Correction. The parser doe not allow thousands separators, so

            1 222,23 would need to become 1222.23


            • 3. Re: nodeValue  and a NaN problem
              Level 7
              thankyou very much....


              "Raymond Basque" <_NOSPAM_rbasque@_NOSPAM_jednm.com> wrote in message
              news:egm34n$9ln$1@forums.macromedia.com...
              >I changed my regional settings to test this, and it looks like there's no
              > support for international number formats -- and there's no indication it
              > will change with AS3.
              >
              > So you'll need to parse your string data and replace the separators before
              > you can convert the string data.
              >
              > 21,22 would need to become 21.22
              >
              > 1 222,23 would need to become 1,222.23
              >
              > etc...
              >
              >