Is it possible to cut decimal, and not round it. Like this.
decimal number = 12.159m;
How can I easily get 12.15 from number and not 12.16?
Is there an easy way or is the string manipulation the only way?
You can try this
decimal number = 12.159m;
number = Math.Truncate(number * 100m) / 100m;
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