<legend id='PeUWb'><style id='PeUWb'><dir id='PeUWb'><q id='PeUWb'></q></dir></style></legend>

    <tfoot id='PeUWb'></tfoot>

      1. <small id='PeUWb'></small><noframes id='PeUWb'>

        <i id='PeUWb'><tr id='PeUWb'><dt id='PeUWb'><q id='PeUWb'><span id='PeUWb'><b id='PeUWb'><form id='PeUWb'><ins id='PeUWb'></ins><ul id='PeUWb'></ul><sub id='PeUWb'></sub></form><legend id='PeUWb'></legend><bdo id='PeUWb'><pre id='PeUWb'><center id='PeUWb'></center></pre></bdo></b><th id='PeUWb'></th></span></q></dt></tr></i><div id='PeUWb'><tfoot id='PeUWb'></tfoot><dl id='PeUWb'><fieldset id='PeUWb'></fieldset></dl></div>

          <bdo id='PeUWb'></bdo><ul id='PeUWb'></ul>

        将逗号应用于 MySQL 中的数字字段

        Apply comma to number field in MySQL(将逗号应用于 MySQL 中的数字字段)
      2. <tfoot id='cJe97'></tfoot>
        • <bdo id='cJe97'></bdo><ul id='cJe97'></ul>
              • <i id='cJe97'><tr id='cJe97'><dt id='cJe97'><q id='cJe97'><span id='cJe97'><b id='cJe97'><form id='cJe97'><ins id='cJe97'></ins><ul id='cJe97'></ul><sub id='cJe97'></sub></form><legend id='cJe97'></legend><bdo id='cJe97'><pre id='cJe97'><center id='cJe97'></center></pre></bdo></b><th id='cJe97'></th></span></q></dt></tr></i><div id='cJe97'><tfoot id='cJe97'></tfoot><dl id='cJe97'><fieldset id='cJe97'></fieldset></dl></div>

                    <tbody id='cJe97'></tbody>

                  <small id='cJe97'></small><noframes id='cJe97'>

                1. <legend id='cJe97'><style id='cJe97'><dir id='cJe97'><q id='cJe97'></q></dir></style></legend>
                  本文介绍了将逗号应用于 MySQL 中的数字字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一列包含数字.是否可以使用功能使数字在服务器端以逗号显示?或者我需要在客户端使用 php 脚本吗?我更喜欢服务器端.

                  I have a column that contains numbers. Is it possible to make the numbers appear with a comma on Server-Side with a function? or do I need to this on the client side with a php script? I would prefer server-side.

                  提前致谢.

                  推荐答案

                  只要使用 MySQL 的 FORMAT() 函数

                  Just use MySQL's FORMAT() function

                  mysql> SELECT FORMAT(12332.123456, 4);
                          -> '12,332.1235'
                  mysql> SELECT FORMAT(12332.1,4);
                          -> '12,332.1000'
                  mysql> SELECT FORMAT(12332.2,0);
                          -> '12,332'
                  mysql> SELECT FORMAT(12332.2,2,'de_DE');
                          -> '12.332,20'
                  

                  或者 PHP 的 number_format()

                  Or PHP's number_format()

                  <?php
                  
                  $number = 1234.56;
                  
                  // english notation (default)
                  $english_format_number = number_format($number);
                  // 1,235
                  
                  // French notation
                  $nombre_format_francais = number_format($number, 2, ',', ' ');
                  // 1 234,56
                  
                  $number = 1234.5678;
                  
                  // english notation without thousands separator
                  $english_format_number = number_format($number, 2, '.', '');
                  // 1234.57
                  
                  ?>
                  

                  这篇关于将逗号应用于 MySQL 中的数字字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Converting between timezones in PHP(在 PHP 中的时区之间转换)
                  PHP - strtotime, specify timezone(PHP - strtotime,指定时区)
                  Get current date, given a timezone in PHP?(获取当前日期,给定 PHP 中的时区?)
                  List of US Time Zones for PHP to use?(PHP 使用的美国时区列表?)
                  How to detect Ambiguous and Invalid DateTime in PHP?(如何在 PHP 中检测不明确和无效的 DateTime?)
                  How to update timezonedb in PHP (updating timezones info)?(如何在 PHP 中更新 timezonedb(更新时区信息)?)
                    <tbody id='nj1XJ'></tbody>

                  • <i id='nj1XJ'><tr id='nj1XJ'><dt id='nj1XJ'><q id='nj1XJ'><span id='nj1XJ'><b id='nj1XJ'><form id='nj1XJ'><ins id='nj1XJ'></ins><ul id='nj1XJ'></ul><sub id='nj1XJ'></sub></form><legend id='nj1XJ'></legend><bdo id='nj1XJ'><pre id='nj1XJ'><center id='nj1XJ'></center></pre></bdo></b><th id='nj1XJ'></th></span></q></dt></tr></i><div id='nj1XJ'><tfoot id='nj1XJ'></tfoot><dl id='nj1XJ'><fieldset id='nj1XJ'></fieldset></dl></div>
                    • <tfoot id='nj1XJ'></tfoot>
                      <legend id='nj1XJ'><style id='nj1XJ'><dir id='nj1XJ'><q id='nj1XJ'></q></dir></style></legend>
                        <bdo id='nj1XJ'></bdo><ul id='nj1XJ'></ul>

                            <small id='nj1XJ'></small><noframes id='nj1XJ'>