There are a couple of ways of doing what you want... either format the number as you want it displayed, or use a Masked Editbox to control the format of input/output...
Gives a few examples and outputing a number in various ways... there are many more resources like that throughout the web... google "c# format double".
'double' is the incorrect datatype to use for money. You should be using the decimal type. If you don't, then you'll run into rounding issues all the time which will throw the balance off.
As for displaying the correct value on the till, .ToString () won't do the job unfortunately as it doesn't enforce that only 2 decimal places will be displayed. You can probably use ToString ("{0:0.00}") which will enforce exactly two decimal places are used to display the number. I don't think this method rounds the value though, so 2.999 would show up as 2.99 instead of 3.00 as you might want.
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
Bookmarks