We also need to see (a sample of) your input data.
I suspect the amount contains a currency symbol which would cause it to be treated as zero as a number, which would look okay to you when you echo it but makes no sense to the computer trying to use it as a number. If you do have a currency symbol as part of the data, you either need to remove it from the csv data and only display the currency symbol when you display values (this is the preferred solution) or you need to strip it off before using the value in a calculation (not the preferred solution.) Also, if you have commas as 1000’s separators in the numbers, these should also be removed from the csv data and only used when you display values. Both currency symbols and commas as 1000’s separators are human conventions to make values more readable to us, but don’t work with a computer trying to use the values as numbers.