Price bean in logic hook

Hi,
in my custom module, with logic hook after save, I read the price from the products module and save it in a field of my module.

Everything works but if the user uses the comma as a decimal separator instead of the point, an incorrect number is returned.
How do I format the data correctly according to the user’s settings?

I think here
$bean->prezzo_c = $prezzo;
a global function must be called. Which?

Hello,
Can you try ?

require_once("modules/Currencies/Currency.php");
$bean->prezzo_c =  currency_format_number($prezzo);
3 Likes

Thanks, it’s working!