3 Replies Latest reply on Aug 8, 2014 3:30 PM by nickchapin

    Cents not rounding correctly

    maddie

      In a point of sale system, my client wants to see the change presented in a two decimal format. The calculation I'm using is

       

      Round ( Sales::Amt Tendered - Sales::Total ; 2 )

       

      as the amt tendered is greater than the total price of the sale. If I were to process a sale and the total was $131.05 and the customer gave me $131.15 their change would be ten cents. Unfortunately whenever the change variable has a 0 as the second decimal place it will not show. So instead of showing .10 as a change, it is showing .1 as change.

       

      The round should work as it's set to 2 decimal points, and I can't add decimal points either, that's impossible. Even if it were if I were to add .000 the change might show up as .100

        • 1. Re: Cents not rounding correctly
          jbante

          The rounding is working fine, but the display of that number in your layout could be tweaked to match your formatting. Select the number field object on your layout, then in the Inspector go to the Data tab > Data Formatting section, select the number format chiclet, specify "Currency" from the "Format" pop-up, turn on "Fixed number of decimals" and show 2 decimals.

           

          Note that this will round any precision less than 1 cent to the nearest cent in the display, but you should not consider this a substitute for your rounding calculation. This formatting on the layout object does not affect the stored data, which still needs to be correct to the precision of your transactions.

          • 2. Re: Cents not rounding correctly
            nickchapin

            In layout mode select  the field then in the inspector select data formatting. Pick Currency and the ensure that the checkbox to show the fixed number of decimals (2) is ticked.

            • 3. Re: Cents not rounding correctly
              nickchapin

              Jeremy, you beat me to the punch.  : )