Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

How do I total a column of currency that\'s in .000 format and then have it round up or down in the total field?

Avatar

Level 4

I have a table that figures mileage at .576 per mile and in the total field I want the total to display as the nearest whole cents result, such as $56.23 or $56.22 depending on the result. I can Sum the column with success but it's the rounding up or down that I don't know how to write into that field. I'd appreciate any help you can offer. Thank you.

1 Reply

Avatar

Level 7

If your total is a Decimal Field set to two decimal places, that should take care of it for you.

765990_pastedImage_0.png

Here's my solution. (The field nfTotal has the settings pictured above.)

765991_pastedImage_1.png

Side note: If you just wanted to test to verify that you'll get the right answer when rounding using a decimal field, create two decimal fields--one with two trailing digits and the other with three. Set the calculate script of one with two decimals to copy the rawValue of the one with three decimals.