首页 \ 问答 \ Android - 小数点后2位[重复](Android - Round to 2 decimal places [duplicate])

Android - 小数点后2位[重复](Android - Round to 2 decimal places [duplicate])

可能重复:
在小数点后将一个双数乘以2个有效数字

我知道有很多关于如何舍弃这种数字的例子。 有可能有人告诉我如何回合双倍,以获得值,我可以显示为字符串,并且总是有2位小数位?


Possible Duplicate:
Round a double to 2 significant figures after decimal point

I know that there are plenty of examples on how to round this kind numbers. But could someone show me how to round double, to get value that I can display as a String and ALWAYS have 2 decimal places?


原文:https://stackoverflow.com/questions/9366280
更新时间:2023-05-21 22:05

最满意答案

尝试设置参数“默认值”以使用与“可用值”相同的查询。 实际上,它将每个“可用值”提供为“默认值”,并自动选中“全选”选项。


Try setting the parameters' "default value" to use the same query as the "available values". In effect it provides every single "available value" as a "default value" and the "Select All" option is automatically checked.

相关问答

更多
  • 所以我跑了SQL事件探查器,看到错误来自正在寻找的代码是一个空的(@param为空)是一个错误,因为我已经选择了sead,现在允许null 谢谢你克里斯拉塔你帮帮我分配:) So i Ran the SQL Profiler and seen that the errors came from the code that is looking is the param a null (@param is null) that was the mistake because i allready sead i ...
  • 尝试设置参数“默认值”以使用与“可用值”相同的查询。 实际上,它将每个“可用值”提供为“默认值”,并自动选中“全选”选项。 Try setting the parameters' "default value" to use the same query as the "available values". In effect it provides every single "available value" as a "default value" and the "Select All" option ...
  • 在您调用子报告的Action中,映射到shippingIDs_sub的位置,只要数据集中的值为NULL,就使用表达式传递一些有效值。 =IIF(IsNothing(Fields!ShippingID.value),"Some Valid Value",Fields!ShippingID.value) 至于这个: 有没有办法过滤掉NULL并仅为现有ID运行子报表? 不,您无法关闭转到子报表的功能,但您可以通过更改用户点击的内容来“隐藏”它,使其看起来不像是可点击的。 例如,在我们的报告中,当某些内容可以点击 ...
  • 快速修复可能是删除报告的服务器版本,并将.rdl重新部署/上载为新报告。 当上传新定义以替换现有报告时,SSRS会保留一些有关报告的元数据。 这包括参数的一些属性。 从服务器删除报告时,将删除此元数据。 如果删除报告的服务器版本,您将丢失订阅,并且可能需要重新连接数据源,但如果报告在本地工作,那么我认为这将解决问题。 A quick fix might be to delete the server version of the report and redeploy/upload your .rdl as ...
  • 使用join()将参数的值放入字符串中。 所以它会...... =join(Parameters!Thingy.Value, ",") 然后,您可以看到字符串返回的值。 例如 =iif(join(Parameters!Thingy.Value, ",") = "0,1", TRUE, FALSE) Use join() to put the values of the parameter into a string. So it would be.. =join(Parameters!Thingy.Va ...
  • 多值参数是一个数组,要显示逗号分隔列表,您需要执行以下操作: =Join(Parameters!MultiValueParam.Value, ",") The multivalue parameter is an array, to display a comma separated list you need to do something like this: =Join(Parameters!MultiValueParam.Value, ",")
  • 您是否尝试将参数选择放在单个字符串中? 您可以使用JOIN将它们放入单个文本行: =Join(Parameters!TagHum.Value, ";") https://msdn.microsoft.com/en-us/library/aa337292(SQL.90).aspx Are you trying to put your parameter selections in a single string? You can use JOIN to put them into a single text ...
  • 我也遇到了这个问题,不支持将唯一标识符的默认值指定(我找不到任何来源支持这个,只是我自己的经验)。 是否有特定原因导致您无法使用查询中的获取值 ? 解决方案user1578107地址也可以使用,使用转换将varchar(36)传递给您的参数: select convert(varchar(36),Id) from table I have also ran into this problem, specifying default values to a Unique identifier is not ...
  • 我遇到了一个非常类似的问题 - 正如您所见,最奇怪的部分是,当选择一个参数但不适用于多个参数时,它可以工作。 无论如何,我通过稍微不同地将Parameters传递给存储过程来解决这个问题 - 在数据集的Parameters部分中使用以下表达式: =Join(Parameters!Value.Value, ",")替换参数名称。 这实际上仍然会传递相同的逗号分隔的值字符串,但由于某种原因似乎正确处理引号。 I experienced a very similar problem - the weirdest ...
  • 有趣的问题,我唯一能想到的是将参数数组转换为数据集中的xml,然后通过xml节点将其转换为表。 然后应该在表达式中将数据集参数(让我们称之为@par)设置为: = "" + join(Parameters!P.Value,"") + "" 然后查询数据集将是这样的: declare @parxml xml = @par Select p.query('./text()') from @parxml.nodes('/n') as T(p) 这将提供一个表,每个选定的参数值都有一 ...

相关文章

更多

最新问答

更多
  • sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
  • 如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
  • AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
  • Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
  • 湖北京山哪里有修平板计算机的
  • SimplePie问题(SimplePie Problem)
  • 在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
  • HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
  • 为什么我会收到链接错误?(Why do I get a linker error?)
  • 如何正确定义析构函数(How to properly define destructor)
  • 垂直切换菜单打开第3级父级。(Vertical toggle menu 3rd level parent stay opened. jQuery)
  • 类型不匹配 - JavaScript(Type mismatch - JavaScript)
  • 为什么当我将模型传递给我的.Net MVC 4控制器操作时,它坚持在部分更新中使用它?(Why is it that when I pass a Model to my .Net MVC 4 Controller Action it insists on using it in the Partial Update?)
  • 在使用熊猫和statsmodels时拉取变量名称(Pulling variable names when using pandas and statsmodels)
  • 如何开启mysql计划事件
  • 检查数组的总和是否大于最大数,反之亦然javascript(checking if sum of array is greater than max number and vice versa javascript)
  • 使用OpenGL ES绘制轮廓(Drawing Outline with OpenGL ES)
  • java日历格式(java Calendar format)
  • Python PANDAS:将pandas / numpy转换为dask数据框/数组(Python PANDAS: Converting from pandas/numpy to dask dataframe/array)
  • 如何搜索附加在elasticsearch索引中的文档的内容(How to search a content of a document attached in elasticsearch index)
  • LinQ to Entities:做相反的查询(LinQ to Entities: Doing the opposite query)
  • 从ExtJs 4.1商店中删除记录时会触发哪些事件(Which events get fired when a record is removed from ExtJs 4.1 store)
  • 运行javascript后如何截取网页截图[关闭](How to take screenshot of a webpage after running javascript [closed])
  • 如何使用GlassFish打印完整的堆栈跟踪?(How can I print the full stack trace with GlassFish?)
  • 如何获取某个exe应用程序的出站HTTP请求?(how to get the outbound HTTP request of a certain exe application?)
  • 嗨,Android重叠背景片段和膨胀异常(Hi, Android overlapping background fragment and inflate exception)
  • Assimp详细说明typedef(Assimp elaborated type refers to typedef)
  • 初始化继承类中不同对象的列表(initialize list of different objects in inherited class)
  • 使用jquery ajax在gridview行中保存星级评分(Save star rating in a gridview row using jquery ajax)
  • Geoxml3 groundOverlay zIndex(Geoxml3 groundOverlay zIndex)