久久久久久久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>
                          • 主站蜘蛛池模板: 日韩福利 | 亚洲精品1 | 黑人精品欧美一区二区蜜桃 | 久久亚洲一区 | 国产精品毛片一区二区三区 | 97色免费视频 | 欧美在线天堂 | 91日日| 精品一区二区三区四区 | 日日草天天干 | 在线欧美一区二区 | 亚洲在线一区二区 | 中文字幕动漫成人 | 亚洲 欧美 另类 日韩 | 国产精品高清在线 | 国产不卡一区 | 中文字幕在线国产 | 欧美在线a | 久久精品国产99国产精品亚洲 | 日本免费小视频 | 国产亚洲精品精品国产亚洲综合 | 国产一区二区三区精品久久久 | 欧美日韩在线播放 | 久久久久久免费观看 | 国产探花在线精品一区二区 | 国产乱码精品一区二区三区五月婷 | av中文在线观看 | 亚洲在线免费观看 | 四虎影院美女 | 亚洲+变态+欧美+另类+精品 | 天天视频一区二区三区 | 欧美性猛交一区二区三区精品 | 久久精品国产久精国产 | 国产区在线观看 | 日韩图区| 天天操天天摸天天干 | 精品乱码一区二区三四区视频 | 91秦先生艺校小琴 | 欧美亚洲国产一区二区三区 | 欧美日韩在线精品 | 黄篇网址 |