Page 3 of 3

Re: Round to nearest even dollar

Posted: Mon Sep 28, 2015 6:14 pm
by jrSD
Ivan wrote:Hello,
jrSD wrote:Is there a better way to accomplish this?
If you need to use this expression in several places, it is better to describe it as a function, and use this function in expressions.
For example, you can add following function into the report, on the Code tab of designer:

Code: Select all

		Function MyRound(ByVal num As Double) As Double
			MyRound = CInt((Math.Round(num+0.00001,4)+1)/2)*2
		End Function
and then use this function in expressions:

Code: Select all

{MyRound(3.75)}
{MyRound(4.1)}
Thank you.

Brilliant! Thank you very much!!

Re: Round to nearest even dollar

Posted: Mon Sep 28, 2015 11:12 pm
by Ivan
Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.