How do Calculation fields work?

How do I control the format of a calculation field for numbers and currency?

Where can I find more details on the calculation fields?

Where can I find references for calculation functions?

Where can I find examples of calculation field code?