首页 \ 问答 \ Excel - 如何显示“0”,“+”或“ - ”?(Excel - how to display “0”, “+” or “-”?)

Excel - 如何显示“0”,“+”或“ - ”?(Excel - how to display “0”, “+” or “-”?)

我已经尝试了谷歌搜索一段时间了,但我还没有找到答案。

如果我有一个数字(正数,负数或等于零),让我们说括号A1,我希望括号A2显示“+”如果A1为正,“ - ”如果A1为负或“0”如果A1是零,有人知道如何在Excel中编码吗?

谢谢。


I have tried googling for some time now, but I have not yet found the answer.

If I have an number (positive, negative, or equal to zero) in, let's say bracket A1, and I wish bracket A2 to show "+" if A1 is positive, "-" if A1 is negative or "0" if A1 is zero, does anyone know how to code this in excel?

Thank you.


原文:https://stackoverflow.com/questions/33466966
更新时间:2024-02-26 20:02

最满意答案

减少耦合的愿望是值得称赞的,但在边界处,应用程序不再是面向对象的 。 特别是对于WCF应用程序,边界由XSD和WSDL定义,因此通过线路传输的数据不再是对象 ,而是XML(或者至少是XML信息集)。 那些数据没有任何行为。

SOAP服务与其客户端之间的耦合由合同定义; 即WSDL。 即使您可以在实现中返回接口,它仍然会以XML格式传输,因此它没有任何区别。


The desire to decrease coupling is laudable, but at the boundary, an application is no longer object-oriented. Particularly for WCF applications, the boundary is defined by XSD and WSDL, so the data travelling over the wire is no longer objects, but rather XML (or, at least, XML infosets). That data has no behaviour.

The coupling between a SOAP service and its clients is defined by the contract; i.e. the WSDL. Even if you could return interfaces in your implementation, it would still travel over the wire as XML, so it would make no difference.

相关问答

更多
  • 从理论上讲,我认为输出格式不可知属性是可能的,尽管它取决于你想要支持的输出格式的类似方式(dis)。 例如,XML和JSON都使用字段名称,但JSON没有区分XML所具有的属性和元素。 另一方面,二进制序列化通常对字段名称没有用处,因为信息通常是存储位置的。 说实话,我从未见过这样的实现。 我经常看到的是你定义了两个“模式”: 其中一个实体类以与存储无关的方式定义,并且设计为易于在业务逻辑中处理(即具有计算属性,继承以及其他可能对您有所帮助)。 另一组类仅设计为序列化为一种特定的输出格式。 对于XML,这可 ...
  • 在GC运行之前,内存可能会保持增加,这与数据返回到客户端时无关。 您是否尝试在服务方法中添加断点或某种记录以确保在每个请求上调用该方法? 我不认为WCF会自行进行任何缓存; 至少,我从来没有在我的应用程序中使用它。 编辑: 在垃圾收集器运行之前,内存将保持使用状态。 如果你的进程在其堆中仍有足够的可用空间,那么GC就没有理由运行。 根据MSDN: http : //msdn.microsoft.com/en-us/library/ee787088.aspx#conditions_for_a_garbage_ ...
  • 不,数据合同不需要[Serializable] 。 它也不是XML序列化的必要条件。 No, [Serializable] is not necessary on a data contract. It is also not necessary for XML Serialization.
  • 整个依赖注入的思想是有一些容器可以为你解决你的依赖问题。 你有没有理由不使用框架来注入你的依赖关系,比如说结构图或统一性? 如果你有一个容器,你应该从容器中为你实例化一个新的类型实例,并解析所有依赖关系(如果有的话)。 The whole idea of dependency injection is that there's some container which resolves your dependencies for you. Is there a reason your not using a ...
  • 有可能的! WCF为WCF责任链提供了一个名为IInstanceProvider的插件 。 这允许您用自己的结构替换结构。 有人将此作为服务行为实现,可在此处获取: http : //code.msdn.microsoft.com/WCFResources/Release/ProjectReleases.aspx?ReleaseId = 1252 It is possible! WCF provides a plugin to the WCF responsibility chain called an I ...
  • 我还没有找到成功修复此特定问题的方法(除非在我的构造函数中捕获此特定异常并检查它是否是设计时间)。 我假设Visual Studio设计时编译在一个单独的位置,并不复制app.config文件。 但是,我发现我正在进行用户控制依赖注入错误(参见: 此处和此处 ) 因此,对于我的特定错误控制,我已经用属性注入替换了我的构造函数注入(实际上通过方法,但是嘿)。 public ucSelectStock() { InitializeComponent(); } public void LoadContr ...
  • 由于您的用户对象具有DB对象的依赖关系,并且无法序列化DB对象,因此您的用户对象本身也无法序列化。 所以基本上你的问题是你序列化一个不可序列化的对象。 你真正需要的是会话状态。 创建一个能够选择模型(集合)并且能够提供模型(get)的会话状态对象。 通过向会话对象添加逻辑,可以如何序列化特定对象(或更好:存储在会话中,例如,如果它是数据库模型,通常只需要存储ID),这将像任何其他工厂一样工作。 然后将Session对象注入为依赖项。 As your user object has a dependency ...
  • 据我所知,这里的问题是你应该在你的存储库中创建你的上下文,事实上你实际上是在新建服务中的上下文然后将它传递到你的存储库有点代码味道。 为什么不让存储库处理DbContext? 这样,您就不会首先将您的存储库耦合到Entity Framework。 该服务应该只依赖于IUserRepository接口..而不是具体的实现。 private readonly IUserRepository _userRepository; public MyService(IUserRepository userReposi ...
  • WCF中的依赖注入不是一件容易实现的事情。 您基本上需要实现一个IServiceProvider ,当需要创建新的服务实例时,将调用该IServiceProvider 。 然后,您可以使用Windsor或其他IoC工具来获取存储库实例。 您可以在http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/31/wcf-extensibility-iinstanceprovider.aspx上的实例提供程序的帖子中找到此类IoC容器的示例。 Dependenc ...
  • 减少耦合的愿望是值得称赞的,但在边界处,应用程序不再是面向对象的 。 特别是对于WCF应用程序,边界由XSD和WSDL定义,因此通过线路传输的数据不再是对象 ,而是XML(或者至少是XML信息集)。 那些数据没有任何行为。 SOAP服务与其客户端之间的耦合由合同定义; 即WSDL。 即使您可以在实现中返回接口,它仍然会以XML格式传输,因此它没有任何区别。 The desire to decrease coupling is laudable, but at the boundary, an applica ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)