dollarformat

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

    #1

    dollarformat

    document.test.f orm.itemprice.v alue = itemprice;
    alert(itemprice );

    If the value is 800.16, it keeps showing as 800.1600.
    what will be the function to make this value as a money type?



  • RobG

    #2
    Re: dollarformat

    Check out the group FAQ:

    <URL:http://jibbering.com/faq/#FAQ4_6>

    Comment

    • RobG

      #3
      Re: dollarformat

      Sorry, the URL was incomplete. Seems the new version of Firefox is a
      bit different...

      <URL:http://www.jibbering.c om/faq/#FAQ4_6>

      Comment

      • HandersonVA

        #4
        Re: dollarformat

        complex than what I thought. any simple function name to format it?
        such as dollarformat(va riables)

        "RobG" <rgqld@iinet.ne t.au> wrote in message
        news:1115688241 .007405.283640@ o13g2000cwo.goo glegroups.com.. .[color=blue]
        > Sorry, the URL was incomplete. Seems the new version of Firefox is a
        > bit different...
        >
        > <URL:http://www.jibbering.c om/faq/#FAQ4_6>
        >[/color]


        Comment

        • Evertjan.

          #5
          Re: dollarformat

          HandersonVA wrote on 10 mei 2005 in comp.lang.javas cript:
          [color=blue]
          > "RobG" <rgqld@iinet.ne t.au> wrote in message[color=green]
          >> Sorry, the URL was incomplete. Seems the new version of Firefox is a
          >> bit different...
          >>
          >> <URL:http://www.jibbering.c om/faq/#FAQ4_6>[/color][/color]

          [please do not toppost on usenet]
          [color=blue]
          > complex than what I thought. any simple function name to format it?
          > such as dollarformat(va riables)[/color]

          As we don't all live in a dollar country,
          I wouldn't pretend to know what you mean by "dollarform at".

          v = 23.5;
          document.write( euroformat(v)+' <br>');

          v = -123;
          document.write( euroformat(v)+' <br>');

          function euroformat(x){
          return "&euro;&nbs p;" + x.toFixed(2);
          };

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

          Comment

          • Dr John Stockton

            #6
            Re: dollarformat

            JRS: In article <Xns96526902E78 07eejj99@194.10 9.133.29>, dated Tue, 10
            May 2005 08:19:18, seen in news:comp.lang. javascript, Evertjan.
            <exjxw.hannivoo rt@interxnl.net > posted :[color=blue]
            >
            >function euroformat(x){
            > return "&euro;&nbs p;" + x.toFixed(2);
            >};[/color]

            For browsers that implement &euro; and toFixed. And the FAQ says that
            some toFixed is buggy.

            € gives a Euro sign on at least some systems that do not have
            &euro; .

            I wonder whether UniCode has a place reserved for the specifically-US
            dollar? All sorts of people use \u0024; .

            --
            © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
            <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
            <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
            <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

            Comment

            • Evertjan.

              #7
              Re: dollarformat

              Dr John Stockton wrote on 10 mei 2005 in comp.lang.javas cript:
              [color=blue]
              > I wonder whether UniCode has a place reserved for the specifically-US
              > dollar?[/color]

              And what about the specifically-Canadian one?

              And the British dollar? ;-\}
              [color=blue]
              > All sorts of people use \u0024; .[/color]

              Not all, my sort does not, we use the &euro;
              even though it is not an Uni[que]code

              ;-/}

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

              Comment

              Working...