久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='bzkop'></tfoot>
  • <legend id='bzkop'><style id='bzkop'><dir id='bzkop'><q id='bzkop'></q></dir></style></legend>

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

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

      1. Android 數字格式在某種程度上是錯誤的,而不是

        Android number format is wrong somehow, instead of 3.5 I get 3.499999999, why?(Android 數字格式在某種程度上是錯誤的,而不是 3.5 我得到 3.499999999,為什么?)

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

        • <small id='LyKBR'></small><noframes id='LyKBR'>

          • <bdo id='LyKBR'></bdo><ul id='LyKBR'></ul>
              <tbody id='LyKBR'></tbody>
          • <legend id='LyKBR'><style id='LyKBR'><dir id='LyKBR'><q id='LyKBR'></q></dir></style></legend>

                <tfoot id='LyKBR'></tfoot>

                  本文介紹了Android 數字格式在某種程度上是錯誤的,而不是 3.5 我得到 3.499999999,為什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我將一些數據存儲在數據庫中,并使用游標讀取這些數據.所有數據均為 56.45 , 3.04, 0.03 類型,所以小數點后有兩位數.現在我想對它們求和,但這似乎并不容易......我用 c.getDouble(3) 得到這些數字,然后我將它添加到 sum 變量中,例如:

                  I store some data in a database and I read those data with a cursor. All the data are 56.45 , 3.04, 0.03 type, so two numbers after the decimal point. Now I would like to sum them but it doesnt seem to be easy... I get those number with c.getDouble(3) then I add it to the sum variable like:

                  sum+= c.getDouble(4) * multi
                  

                  multi 是 1 到 100 之間的整數.現在我的問題是,在得到 sum 變量后,我得到一個數字,例如:59.51999999999999999.我沒有發布代碼,但除了 string.valueOf 用于使數字出現在我的小部件上之外,沒有任何轉換.所以有人經歷過嗎?據我計算,它應該是 59.52,但我得到的數字是 99999……為什么會這樣?(有趣的是,使用 Math.round() 不起作用,即使我設置 (sum)*100/100 ,我也會得到 59.0 ..提前致謝!

                  multi is an integer between 1 and 100. Now my problem is that, after getting the sum variable I get a number like: 59.51999999999999999. I do not post a code, but there is no conversion except a string.valueOf for making the number appear on my widget. So anybody experienced this? As I count it should be 59.52, but instead I get that number with 99999... Why is that happening? (funny thing that with a Math.round() does not work, I get 59.0 even if I set (sum)*100 / 100.. Thanks in advance!

                  推薦答案

                  其他方法,你可以定義你的 sum 變量為 double 然后你可以為你的設置 NumberFormat總和變量.

                  Other approach, you can define your sum variable as double and then you can set NumberFormat for your sum variable.

                  示例:

                  double sum = 21.2015;
                  NumberFormat formatter = new DecimalFormat("#.##");
                  formatter.format(sum);
                  

                  這篇關于Android 數字格式在某種程度上是錯誤的,而不是 3.5 我得到 3.499999999,為什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                      <i id='cc7zk'><tr id='cc7zk'><dt id='cc7zk'><q id='cc7zk'><span id='cc7zk'><b id='cc7zk'><form id='cc7zk'><ins id='cc7zk'></ins><ul id='cc7zk'></ul><sub id='cc7zk'></sub></form><legend id='cc7zk'></legend><bdo id='cc7zk'><pre id='cc7zk'><center id='cc7zk'></center></pre></bdo></b><th id='cc7zk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cc7zk'><tfoot id='cc7zk'></tfoot><dl id='cc7zk'><fieldset id='cc7zk'></fieldset></dl></div>
                        • <bdo id='cc7zk'></bdo><ul id='cc7zk'></ul>
                        • <small id='cc7zk'></small><noframes id='cc7zk'>

                            <tbody id='cc7zk'></tbody>

                            <legend id='cc7zk'><style id='cc7zk'><dir id='cc7zk'><q id='cc7zk'></q></dir></style></legend>
                          • <tfoot id='cc7zk'></tfoot>
                          • 主站蜘蛛池模板: 91精品国产手机 | 亚洲国产精品久久久久秋霞不卡 | 日韩视频一区二区 | 亚洲一级黄色 | 欧美性一区二区三区 | 精品久久久一区 | av中文字幕在线 | 久久亚洲综合 | 亚洲综合久久精品 | 中文av字幕 | 欧美精品一区在线 | 日韩视频精品在线 | 日本午夜视频 | 国产欧美日韩一区二区三区在线观看 | chinese中国真实乱对白 | 免费看一级毛片 | 天天操综合网 | 成人国产一区二区三区精品麻豆 | 国产成人精品一区二区三区四区 | 欧美亚洲一区二区三区 | 亚洲一区二区成人 | 日韩影院在线观看 | av网址在线 | 亚洲精品一区二区三区中文字幕 | 精品久久精品 | 精品久| 一级黄色毛片子 | 亚洲综合成人网 | 欧美一区二区三区国产 | 亚洲视频在线看 | 国产激情视频网站 | 日韩欧美在线精品 | 黄片毛片免费观看 | 国产伦精品一区二区 | 新疆少妇videos高潮 | 欧美成人精品在线观看 | 午夜av一区二区 | 精品视频一区二区三区在线观看 | 色偷偷888欧美精品久久久 | 美女视频三区 | 亚洲九九精品 |