Jump to content

[SOLVED] problem in numer format


ahmedm177

Recommended Posts

It is most likely because of the commas.

 

so...

 

<?php
$number = 4,100,000

$num = str_replace(",",$number);

echo number_format($num * 2);
?>

 

Thank you little guy

your code solve my problem, but there is a small addition

<?php
$number = 4,100,000

$num = str_replace(",","",$number);

echo number_format($num * 2);
?>

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.