Daniel,
The line that you used:
nNewValue = ((Math.Floor(100 * (nInput / nConstant))) / 100) * nConstant
should work ... with one caveat ... maybe VB is more lenient than C#, but when I tried that with nConstant defined as you had it, as a decimal, I get an error that I can't do that division (nInput / nConstant). But, nConstant should be an integer anyway (it's 3 in this case) ... and that made the error go away, plus it worked just fine.
So, if that's the code you're actually using, I'm not sure what VB is doing differently.
~~Bonnie
>Hi Bruce,
>
>Yes, this is what I ended up using:
>
>Dim nConstant As Decimal
>Dim nInput As Double
>Dim nNewValue As Double
>
>nInput = Convert.ToDouble(txbAMSEZPay.Text)
>nConstant = 3
>
>nNewValue = ((Math.Floor(100 * (nInput / nConstant))) / 100) * nConstant
>
>
>
>All of the below are rounding up:
>
>iNumber = Convert.ToInt32(nDouble)
>iNumber = nDouble \ 1
>iNumber = nDouble
>iNumber = CType(nDouble, Integer)
>iNumber = Math.Round(nDouble, 0)
>iNumber = Math.Ceiling(nDouble, 0)
>
>Thank you,
>Daniel