-5
I will have values like 2600 or 15000 and need to put as 26.00, 150.00, etc. How can I do this in PHP ? With the function number_format
it puts wrong (in my case) as 2600,00 or 15,000,00. How can I do ?
-5
I will have values like 2600 or 15000 and need to put as 26.00, 150.00, etc. How can I do this in PHP ? With the function number_format
it puts wrong (in my case) as 2600,00 or 15,000,00. How can I do ?
1
Do the following:
<?php
$number = "15000";
echo number_format($number, 0, ',', '.');
?>
So he will return: 15,000
This is wrong man, the number must come in the correct amount and you will only add the decimals using the same number_format. If it is coming with zero more you can consider this a bug.
Browser other questions tagged php number-format
You are not signed in. Login or sign up in order to post.
Explain better what you want, because it’s very basic math, just divide by 100, then you do what you want.
– Maniero
So simple né @bigown. I made this split by 100 and it worked :)
– Alisson Acioli
Violating the logic.
– viana