Deprecated: Function money_format() is deprecated in

A1WEBSITEPRO QuestionsCategory: PHPDeprecated: Function money_format() is deprecated in
Jack asked 2 years ago

I am getting this PHP error in PHP7. Do you know how to fix it?

Deprecated: Function money_format() is deprecated in was last modified: August 15th, 2022 by Jack
1 Answers
Best Answer
Maximus Mccullough Staff answered 2 years ago

Update to this new way.  You can put your variable where it says -0.99 and that is all. 🙂

$formatter = new NumberFormatter('en_US', NumberFormatter::CURRENCY);
echo $formatter->formatCurrency(-0.99, 'USD'), PHP_EOL;

Answer for Deprecated: Function money_format() is deprecated in was last modified: August 15th, 2022 by Maximus Mccullough