display fixed decimal digits

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

    display fixed decimal digits

    I have variable, say "total". It can be an integer or floating number.

    No matter what value it stores (5 or 5.1 or 5.24), when I display it, is
    there a way I can make it display it with fixed 2 decimal digits, like 5.00?

    Thanks


  • Ray at

    #2
    Re: display fixed decimal digits

    See the FormatNumber() function in your VB Script documentation, assuming
    you're using VB Script. If you do not have the documentation, download it
    here
    http://www.microsoft.com/downloads/d...displaylang=en,
    or view it online here
    http://msdn.microsoft.com/library/en...riVBScript.asp.

    Ray at work

    "Bei" <karen_lau@hotm ail.com.nospam> wrote in message
    news:eU1Z61eUDH A.2052@TK2MSFTN GP10.phx.gbl...[color=blue]
    > I have variable, say "total". It can be an integer or floating number.
    >
    > No matter what value it stores (5 or 5.1 or 5.24), when I display it, is
    > there a way I can make it display it with fixed 2 decimal digits, like[/color]
    5.00?[color=blue]
    >
    > Thanks
    >
    >[/color]


    Comment

    • Bob Barrows

      #3
      Re: display fixed decimal digits

      Sure. Use the FormatNumber function.

      Bob Barrows
      Bei wrote:[color=blue]
      > I have variable, say "total". It can be an integer or floating number.
      >
      > No matter what value it stores (5 or 5.1 or 5.24), when I display it,
      > is there a way I can make it display it with fixed 2 decimal digits,
      > like 5.00?
      >
      > Thanks[/color]


      Comment

      • Bob Barrows

        #4
        Re: display fixed decimal digits

        :-)
        I'd like to, but our network server's clock is at fault here. They haven't
        fixed it yet ...

        Bob
        Ray at <%=sLocation% > wrote:[color=blue]
        > Hey Bob. Fix you're clock. Stop trying to move the end of the line.
        > :P
        >
        > Ray at work
        >
        > "Bob Barrows" <reb_01501@yaho o.com> wrote in message
        > news:eM9t17eUDH A.1172@TK2MSFTN GP11.phx.gbl...[color=green]
        >> Sure. Use the FormatNumber function.
        >>
        >> Bob Barrows
        >> Bei wrote:[color=darkred]
        >>> I have variable, say "total". It can be an integer or floating
        >>> number.
        >>>
        >>> No matter what value it stores (5 or 5.1 or 5.24), when I display
        >>> it, is there a way I can make it display it with fixed 2 decimal
        >>> digits, like 5.00?
        >>>
        >>> Thanks[/color][/color][/color]


        Comment

        Working...