how to produce output restricted to just 2 decimal places?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tenko
    New Member
    • Oct 2006
    • 4

    how to produce output restricted to just 2 decimal places?

    anybody knows how to produce output restricted to just 2 decimal places?

    thanks :-)
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Hi there,

    kidly refer to below attached link, hope it helps you to get started with, take care my fren.. :)

    Comment

    • tenko
      New Member
      • Oct 2006
      • 4

      #3
      hmm...cant seem to work it out from there. am thinking about using the math.round option but dont know how to write the code....

      Comment

      • sashi
        Recognized Expert Top Contributor
        • Jun 2006
        • 1749

        #4
        Hi there,

        I just don't understand about what you meant by "cant seem to work it out from there", anyway, kindly refer to below code segment, good luck & take care my fren.. :)

        Code:
         Format(1234.56, "#####.##")

        Comment

        • Dawoodoz
          New Member
          • Oct 2006
          • 14

          #5
          I think this will work.

          int( ( X * 100 ) + 0.5 ) / 100

          24.75456 ==>24.76

          I use it whenever I need to debug things in my games.

          Comment

          • tenko
            New Member
            • Oct 2006
            • 4

            #6
            Originally posted by sashi
            Hi there,

            I just don't understand about what you meant by "cant seem to work it out from there", anyway, kindly refer to below code segment, good luck & take care my fren.. :)

            Code:
             Format(1234.56, "#####.##")
            Thanks Sashi! helped me out there... :-)

            Comment

            Working...