Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I round a group summary field with a formula?

Status
Not open for further replies.

pokerace

Technical User
May 24, 2005
118
US
I am tring to get a grouped sumary field to round up to the nearest whole number unless it already is on a whole number.

4.999 = 5
5.4445 = 6
etc, but 5.0 would still equal 5.

I am trying this with the following formula found elsewhere on these forums:

if {number.field} - truncate({number.field}) <> 0 then truncate({number.field})+1 else
{number.field}

it theoretically woul dget me the correct rounding results, but it doesn't work when I replace {number.field} with the summary field I drag down in the formula editor.

If I right click on the field in the report and select format field, then custimize and then click on the round button, I am able to enter a formula. Is that the correct place?

Thanks.
 
You shouldn't need a formula to round it, just use the decimal and round formats when using the right click->format Field->number interface.

Also, try to post specifics. "but it doesn't work when I replace {number.field} with the summary field I drag down in the formula editor" doesn't say what happened, did it not round, show evberything, round incorrectly, or?

-k
 
To roundup a summary try something like:

-int(-sum({table.amt},{table.groupfield}))

You would create this formula in the formula expert and use it instead of your summary.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top