Level 73
@felicia00 the error is pretty clear. The first parameter that you are passing to the number_format function is String.. ie "SOME TEXT" while it needs to be a number, like 1.0 or "1.0".
I think this one is the problem:
number_format(number_format($dtl->claimed_price,2,'.','') - number_format($dtl->value,2,'.',''),2,'.','');
You don't need to format numbers that are already formatted.