Given a decimal '96.154', how can I ensure that it is always rounded up to 96.16 (as opposed to normal rounding to 2 decimals which would give 96.15).
Kind of hacky but a very intuitive way to do so:
var val = 96.154M;
var result = Math.Ceiling(val * 100) / 100.0M;
You can add 0.005 to the value and then round the result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With