c# - Round number Up to next 0.25 in .Net -


this question has answer here:

how can round decimal (not down) 0.25?

1.26 -> 1.50  1.45 -> 1.50  1.15 -> 1.25  1.00 -> 1.00  1.55 -> 1.75  1.77 -> 2.00 

i have tried following function no success.

decimal.round(x * 4, midpointrounding.toeven) / 4 

use ceiling method round up:

decimal.ceiling(x * 4m) / 4m 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -