Jump to content

calculation help needed


spires

Recommended Posts

Hi

 

I have 3 strings.

$discount2 = '12,000';

$discount3 = '1.00';

$discount4 = '10,000.01';

 

I need to add these together.

$less234discount = $discount2 + $discount3 + $discount4;
$less234discount = number_format($less234discount, 2);

 

BUT, it will not calculate past the comma.

It only sees:

12, 1, 10

NOT

12,000

1.00

10,000.01

 

 

How can I add these up correctly?

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/204751-calculation-help-needed/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.