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

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -