Math.Round(Qty / num) * num could work for you, where num is the "rounder".
ex.
double qty = 2300;
double num = 500;
double result = Math.Round(qty / num) * num;
that would give you 2500.
I hope it is useful.
Best Regards,
Jesper
Dim Qty as Double = 243000D
Dim StrQty as String = Qty.ToString("D")
Dim LenFactor as Integer = StrQty.Length() - 2
Dim Answer = math.ceiling(Qty+1,5*10^LenFactor)
Think that works but not on a machine with .net on right now.
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!