Skip to content
Advertisement

Tag: numbers

String and number in for each

I have this code: Expected result (to put as text in another PHP file): $Avroeger = 8.8; $Bvroeger = 5.5; Actual result: (where the 8.3 and 5.7 are the old values of $Avroeger and $Bvroeger) 8.3 = 8.8; 5.7 = 5.5; Anyone who can help? Thank you in advance! Answer You are doing the appending wrong. Do it as shown

Number formatting (Money) in PHP

I’m trying to format numbers with not decimal points or commas, I’ve tried number_format() and money_format() and can’t seem to get the result I need. number_format($item->amount,2) Result: 14,995….

Advertisement