Reputation: 13
im sorry if it will be confusing as the title speaks, but i will explain in details of what i need. sorry for troubling as i am still a newbie in c#. here, lets say:
decimal value = 40.23;
decimal total = Math.Round(value * 20.0m, 0) / 20.0m;
roundingbox.Text = total.ToString("f2");
the output given will be 40.25 without fail. However, im not sure if it is possible to do something like this, e.g: round off amount
please let me know as i have been stuck here for quite some time in my progress to create a pos system. Thanks a lot.
Upvotes: 0
Views: 63
Reputation: 579
decimal difference = value - total;
should give you what you want, no?
Upvotes: 3