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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Round to the nearest even number

Status
Not open for further replies.

jvolden

IS-IT--Management
Jan 26, 2005
77
US
Hello, we are useing Crystal Reports XI and are looking for a way to round to the nearest even number, similar to the CLng function in Visual Basic Scripting.

For example if the number was .5 it would round to 0 and if it was 1.3 it would round to 2.

Does any one know of a similar function in Crystal or have an idea on how to make this work?
Thenk you.
 
Try:

if remainder(truncate({table.number}),2) <> 0 then
truncate({table.number}) + 1 else
truncate({table.number})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top