how to convert integer to string in javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TomislaW

    how to convert integer to string in javascript

    i have number that i need to concatenate with string


  • Evertjan.

    #2
    Re: how to convert integer to string in javascript

    TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:[color=blue]
    > i have number that i need to concatenate with string[/color]

    result = 7 + " dwarfs of Snowwhite."

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    • TomislaW

      #3
      Re: how to convert integer to string in javascript

      "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
      news:Xns9623A2C 94B347eejj99@19 4.109.133.29...[color=blue]
      > TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:[color=green]
      >> i have number that i need to concatenate with string[/color]
      >
      > result = 7 + " dwarfs of Snowwhite."[/color]

      this does not work with firefox(mozilla )


      Comment

      • Evertjan.

        #4
        Re: how to convert integer to string in javascript

        TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:
        [color=blue]
        > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
        > news:Xns9623A2C 94B347eejj99@19 4.109.133.29...[color=green]
        >> TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:[color=darkred]
        >>> i have number that i need to concatenate with string[/color]
        >>
        >> result = 7 + " dwarfs of Snowwhite."[/color]
        >
        > this does not work with firefox(mozilla )[/color]

        I don't believe it. It is basic javascript.

        Could you try to debug with 6 dwarfs perhaps?


        --
        Evertjan.
        The Netherlands.
        (Replace all crosses with dots in my emailaddress)

        Comment

        • Chris Sharman

          #5
          Re: how to convert integer to string in javascript

          TomislaW wrote:
          [color=blue]
          > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
          > news:Xns9623A2C 94B347eejj99@19 4.109.133.29...
          >[color=green]
          >>TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:
          >>[color=darkred]
          >>>i have number that i need to concatenate with string[/color]
          >>
          >>result = 7 + " dwarfs of Snowwhite."[/color]
          >
          >
          > this does not work with firefox(mozilla )
          >
          >[/color]

          MyNum.toString( 10)+MyString

          (10 is decimal, 16 would be hexadecimal)

          Comment

          • Lee

            #6
            Re: how to convert integer to string in javascript

            TomislaW said:[color=blue]
            >
            >"Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
            >news:Xns9623A2 C94B347eejj99@1 94.109.133.29.. .[color=green]
            >> TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:[color=darkred]
            >>> i have number that i need to concatenate with string[/color]
            >>
            >> result = 7 + " dwarfs of Snowwhite."[/color]
            >
            >this does not work with firefox(mozilla )[/color]

            Sure it does. Show us exactly what "does not work".

            Comment

            • John W. Kennedy

              #7
              Re: how to convert integer to string in javascript

              TomislaW wrote:[color=blue]
              > "Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
              > news:Xns9623A2C 94B347eejj99@19 4.109.133.29...
              >[color=green]
              >>TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:
              >>[color=darkred]
              >>>i have number that i need to concatenate with string[/color]
              >>
              >>result = 7 + " dwarfs of Snowwhite."[/color]
              >
              >
              > this does not work with firefox(mozilla )[/color]

              It should. Please show exactly what you are doing that doesn't work.


              ---
              John W. Kennedy
              "I want everybody to be smart. As smart as they can be. A world of
              ignorant people is too dangerous to live in."
              -- Garson Kanin. "Born Yesterday"

              Comment

              • Mick White

                #8
                Re: how to convert integer to string in javascript

                Lee wrote:
                [color=blue]
                > TomislaW said:
                >[color=green]
                >>"Evertjan." <exjxw.hannivoo rt@interxnl.net > wrote in message
                >>news:Xns9623A 2C94B347eejj99@ 194.109.133.29. ..
                >>[color=darkred]
                >>>TomislaW wrote on 24 mrt 2005 in comp.lang.javas cript:
                >>>
                >>>>i have number that i need to concatenate with string
                >>>
                >>>result = 7 + " dwarfs of Snowwhite."[/color]
                >>
                >>this does not work with firefox(mozilla )[/color]
                >
                >
                > Sure it does. Show us exactly what "does not work".
                >[/color]

                num="Zero,One,T wo,Three,Four,F ive,Six,Seven". split(",")

                function fplural(word){r eturn word.substring( 0,word.length-1)+"ves"}
                result=num[7]+" "+ fplural("dwarf" )+" of Snow White";
                document.write( result);

                Mick

                Comment

                Working...