0 is not an amount it’s a placeholder for the tip calculation you made from this tutorial. The calculation takes remaining amount and that amount is inserted where the 0 is.
Read through the tutorial and copy it exact then try to understand it.
Edit: your asking about cash tips in a credit card tip question? Maybe you should look up normal tips first. However this method can be setup for cash payment types as well.