首页
\
问答
\
Sql Server 2008,将十进制值转换为percentaje而不进行舍入?(Sql Server 2008, Convert decimal value to percentaje withouth rounding?)
Sql Server 2008,将十进制值转换为percentaje而不进行舍入?(Sql Server 2008, Convert decimal value to percentaje withouth rounding?)
如何在没有舍入值的情况下将数字0.967741935483870967742转换为%96.77?
到目前为止我有
SELECT VAL1 = '%' + convert(varchar, CONVERT(DECIMAL(10,2), 0.967741935483870967742 * 100 ) FROM my_table
这给了我%97.00;
编辑:我尝试这样做没有任何成功:
SELECT VAL1 = '%' + convert(varchar, CONVERT(DECIMAL(10,2), 0.967741935483870967742 * CONVERT(DECIMAL(10,2), 100) ) FROM my_table
How Can I conver the number 0.967741935483870967742 to %96.77 without rounding values?
So far I have
SELECT VAL1 = '%' + convert(varchar, CONVERT(DECIMAL(10,2), 0.967741935483870967742 * 100 ) FROM my_table
wich gives me %97.00;
Edit: I tried doing this without any success:
SELECT VAL1 = '%' + convert(varchar, CONVERT(DECIMAL(10,2), 0.967741935483870967742 * CONVERT(DECIMAL(10,2), 100) ) FROM my_table
原文:https://stackoverflow.com/questions/19868046
更新时间:2023-08-19 13:08
最满意答案
尝试使用.equals()来比较字符串。
try use .equals() to compare strings.
相关问答
更多-
看来你从服务器得到错误的JSON字符串。 2905-2905/com.appmac.ron.testapp W/System.err: org.json.JSONException: Value
DB< of type java.lang.String cannot be converted to JSONObject 04-23 12:35:53.172 2905-2905/com.appmac.ron.testapp W/System.err: at org.json.JSON.type ...
-
无法获得服务器响应(Fail to get server response)[2023-10-06]
我使用下面的代码来获取供应商服务器的响应 <% URL url = new URL("..."); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.connect(); reader = new BufferedReader(new InputStreamReader(conne ... -
刷新活动后收到来自后台服务的响应(refresh activity after receiving the response from the background service)[2022-07-26]
假设您使用的是真正的服务或不是AsyncTask。 使用BroadcastReceiver模式。 在您的服务中发送广播。 LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent("data_changed")); 在包含你的列表视图的活动中声明你的接收器 private BroadcastReceiver dataChangeReceiver= new BroadcastReceiver() { @Override ... -
这绝对可以用AsyncTask完成...在doInBackground()处理网络请求,一旦doInBackground()完成,在UI线程上触发onPostExecute() ,你可以在那里执行任何将更新UI元素的代码。 如果你需要更通用和可重用的东西,你可能想要实现一个回调...我将把UI线程称为客户端 ,将AsyncTask称为服务器 。 创建一个新接口并创建一些方法存根。 public interface MyEventListener { public void onEventComple ...
-
更改服务器响应的活动(Change activity on server response)[2023-11-16]
假设JSON对象如您所期望的那样: 这是因为线 jObj.getBoolean("error"); 抛出一个错误,将你带到catch子句。 尝试改变它 jObj.optBoolean("error"); 这是一个可选的布尔值,如果'错误'不存在,它将返回false而不是抛出异常。 在附注中,您会遇到一些关于其他“获取”方法的问题,但同样的技术也适用。 Assuming that the JSON object is as as you would expect: It is because the li ... -
发生这种情况是因为在我的活动B中,我取消了所有Volley请求: @Override protected void onStop() { super.onStop(); // Cancel all request VolleySingleton.getInstance() .cancelPendingRequests(VolleySingleton.TAG); } 活动B的onStop()有时会在活动A的onResume()之后运行,因此它将取消A所做的所 ...
-
尝试使用.equals()来比较字符串。 try use .equals() to compare strings.
-
解答: 检查脚本调用,外部文件的来源必须与网站网址相同(如果网站是https,文件来源应该是https)。 Solution : Check for script calling, the sources for external files have to be the same as the website url (if website is https, file sources should be https too).
-
简短回答 - 不要阻止UI线程并等待任何事情。 将Toast移动到处理响应的方法中 private void handleResponse(CapabilitiesResponse capabilitiesResponse) { if (capabilitiesResponse.isSuccess()) { text = capabilitiesResponse.getSupportedCurrencies().get(0).getDescription(); // ...
-
您可以使用AsyncTask 。 将您的请求放在doInBackground() ,完成后,它将转到onPostExecute() 。 这是您可以更新布局/开始另一项活动的地方。 您可以在这里阅读更多内容: http : //developer.android.com/reference/android/os/AsyncTask.html You can use AsyncTask for this. Put your request on doInBackground() and after it fin ...