Forum Discussion

CBH_Service_Acc's avatar
CBH_Service_Acc
Qrew Trainee
24 days ago
Solved

Format Numeric Value 2 Decimal Places

Hello,

I have a Formula Text that calculates and displays data based on the numbers users enter in two other numeric fields. Example: When a user enters a number in my Numerator and Denominator fields, my formula field divides those numbers and then displays the answer in the Percentage field (as shown in the screenshot below).

Is there a way to format the answer to two (2) decimal places, so it's shown as something like 7.33 and not 7.3333333 ? Please let me know.

See the code I used for my formula field below:

var Number Numerator = [Numerator] ;

var Number Denominator = [Denominator] ;

ToText(($Numerator / $Denominator) & " %")

  • Try the Round function:

    ToText(Round($Numerator/$Denominator,0.01) & " %")

    The 0.01 tells Quickbase to round to two decimal places.

4 Replies

  • Try the Round function:

    ToText(Round($Numerator/$Denominator,0.01) & " %")

    The 0.01 tells Quickbase to round to two decimal places.

    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Or else, similar to Excel, you can go to the field properties and set the number of decimal places to display. Under the covers it was still retain it's full precision, but for presentation purposes, it will only show two decimals on forms and reports..

      • CBH_Service_Acc's avatar
        CBH_Service_Acc
        Qrew Trainee

        Mark,

        I completely overlooked that 🤦‍♂️ I see that in the field properties now. I will remember this in the future. Thank you!