Skip to main content
Known Participant
March 23, 2011
Answered

Round to two decimal places

  • March 23, 2011
  • 4 replies
  • 19402 views

How do you round a number to two decimal places?

    This topic has been closed for replies.
    Correct answer Dan_Bracuk

    numberformat()

    4 replies

    talofer99
    Inspiring
    March 24, 2011

    You can also use :

    #DecimalFormat(number)#

    Description

    Converts a number to a decimal-formatted string.

    Returns

    A number as a string formatted with two decimal places and a thousands separator.

    Owainnorth
    Inspiring
    March 24, 2011
    Inspiring
    March 24, 2011

    Why? I mean... no-one would ever use it.

    Apparently.

    It's like you're suggesting people RTFM (Read The FREELY-AVAILABLE Manual ;-). It won't catch on.

    I think the big problem here is that things are so difficult to find stuff on the Web. So how would people be able to find this freely-available manual? If only there was some sort of engine people could use to search for stuff. Then they could JFGI (Just Find Good Information).

    Cough.

    --

    Adam

    Sreeindia
    Participating Frequently
    March 24, 2011

    Hi

    Try this.Am assuming variable name as 'price'

                   #NumberFormat(price,'_____.__')#

         or

                   #NumberFormat(price, "00.00")#

    Dan_BracukCorrect answer
    Inspiring
    March 23, 2011

    numberformat()

    Participating Frequently
    March 23, 2011

    will output 12.36