Rauf Abid
Rauf Abid

Reputation: 1

How to round decimal value in vb.net

I am creating a small project in vb.net. I have a value like 12.13 and want to round it like 13. It should always be the next number to round.for example if I have 22.08 it should round to 23, not 22.

How can I achieve this functionality?

Thanks in Advance.

Upvotes: 0

Views: 310

Answers (1)

SLaks
SLaks

Reputation: 887305

You're looking for Math.Ceiling, which does exactly that.

Note that it will always round negative numbers towards zero.

Upvotes: 4

Related Questions