my question is the following and I guess is really simple. I have a number echoed with PHP. For ex开发者_JAVA百科ample 37452. I would like to have a dot and be displayed like 37.452
My var is $numposts
How is this possible ? Thank you
Take a look at number_format. The signature is:
string number_format ( 
    float $number , int $decimals = 0 , 
    string $dec_point = '.' , string $thousands_sep = ',' 
)
Example:
<?php
echo number_format(37452) . "\n";
// 37,452
echo number_format(37452, 0, ',', '.') . "\n";
// 37.452
?>
use number_format with custom decimal and thousands characters.
number_format(37452, 0, ',', '.');
As The MYYN correctly mentions, you should check out the number_format function:
In your example, you could use it as such:
echo number_format($numposts, 3, ',', '.');
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论