首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在数字中添加逗号

问在数字中添加逗号
EN

Stack Overflow用户
提问于 2015-10-23 14:06:36
回答 4查看 170关注 0票数 1
代码语言:javascript
复制
<html> <head>   <title>Rough Diamond 
 Information</title> </head> 
<body>

<?php

mysql_connect("localhost","root","");
mysql_select_db("basic");
$order = "select * from calculator ";
$result=mysql_query($order);

echo "Rough Diamonds Information:&nbsp; &nbsp; &nbsp; &nbsp;";
echo "<a href='home.html'>Go to main page <br><br>";
?>


<table border="1" style="width:50%">
<tr>
    <th><b>ID</b></th>
    <th><b> Name</b></th>
    <th><b> Total Rough Weight</b></th>
    <th><b>One Carat Price</b></th>
    <th><b>Dollar Rate</b></th>
    <th><b>Payment Days</b></th>
    <th><b>Total Payment</b></th>
</tr>

<?php while($row = mysql_fetch_array($result) ) {

echo "<tr>
<td>".$row['id']."</td>
<td>".$row['name']."</td>
<td>".$row['total_wt']."</td>
<td>".$row['crt_price']."</td>
<td>".$row['dollar_rate']."</td>
<td>".$row['pay_day']."</td>
<td>".$row['total_price']."</td>
</tr>";} ?>

</body>
</html>
EN

回答 4

Stack Overflow用户

发布于 2015-10-23 14:11:37

使用number_format($number);。

查看http://php.net/manual/en/function.number-format.php

票数 2
EN

Stack Overflow用户

发布于 2015-10-23 14:10:55

使用money_format格式化货币,如下所示。

代码语言:javascript
复制
$amount = '300000';
setlocale(LC_MONETARY, 'en_IN');
$amount = money_format('%!i', $amount);
echo $amount; // 3,00,000.00

这是帮助链接Link

票数 1
EN

Stack Overflow用户

发布于 2015-10-23 14:11:05

number_format将为您工作

代码语言:javascript
复制
number_format($row['number'],0);
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33295816

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档