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

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

      1. 在mysql中存储金额

        storing money amounts in mysql(在mysql中存储金额)

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

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

                    <tbody id='JiFsq'></tbody>

                1. <tfoot id='JiFsq'></tfoot>
                2. <legend id='JiFsq'><style id='JiFsq'><dir id='JiFsq'><q id='JiFsq'></q></dir></style></legend>
                  本文介绍了在mysql中存储金额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想将 3.50 存储到 mysql 表中.我有一个存储它的浮点数,但它存储为 3.5,而不是 3.50.我怎样才能让它有尾随零?

                  解决方案

                  不要将货币值存储为浮点数,使用 DECIMAL 或 NUMERIC 类型:

                  MySQL 数字类型文档

                  编辑 &澄清:

                  浮点值容易受到舍入误差的影响,因为它们的精度有限,因此除非您不在乎只能得到 9.99 而不是 10.00,否则您应该使用 DECIMAL/NUMERIC,因为它们是不存在此类问题的定点数.

                  I want to store 3.50 into a mysql table. I have a float that I store it in, but it stores as 3.5, not 3.50. How can I get it to have the trailing zero?

                  解决方案

                  Do not store money values as float, use the DECIMAL or NUMERIC type:

                  Documentation for MySQL Numeric Types

                  EDIT & clarification:

                  Float values are vulnerable to rounding errors are they have limited precision so unless you do not care that you only get 9.99 instead of 10.00 you should use DECIMAL/NUMERIC as they are fixed point numbers which do not have such problems.

                  这篇关于在mysql中存储金额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                  <legend id='5wzam'><style id='5wzam'><dir id='5wzam'><q id='5wzam'></q></dir></style></legend>

                        <tbody id='5wzam'></tbody>

                      <small id='5wzam'></small><noframes id='5wzam'>

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