未终止的
发布于 2024-12-28 17:26:32 字数 1559 浏览 1 评论 0 原文

大家好,我试图做一系列的检查来连接我想要减去和格式化的两个数字。这可能吗?或者有其他选择吗?我在标题中得到了这个错误。谢谢

        <td><fmt:formatNumber value='${'
        <c:choose>
        <c:when test="${columnB == 'MWS'}">'line.initialQS.quantities[0]'</c:when> 
        <c:when test="${columnB == 'SMC Unfunded'}">'line.expectedUnfundedQS.quantities[0]'</c:when>
        <c:when test="${columnB == 'SMC Funded'}">'line.expectedFundedQS.quantities[0]'</c:when>
        <c:when test="${columnB == 'MMC'}">'line.targetQS.quantities[0]'</c:when>
        <c:when test="${columnB == 'Current Scenario'}">'line.currentQS.quantities[0]'</c:when>
        <c:otherwise>
           </c:otherwise>
           </c:choose>
        ' - '
        <c:choose>
        <c:when test="${columnA == 'MWS'}">'line.initialQS.quantities[0]'</c:when> 
        <c:when test="${columnA == 'SMC Unfunded'}">'line.expectedUnfundedQS.quantities[0]'</c:when>
        <c:when test="${columnA == 'SMC Funded'}">'line.expectedFundedQS.quantities[0]'</c:when>
        <c:when test="${columnA == 'MMC'}">'line.targetQS.quantities[0]'</c:when>
        <c:when test="${columnA == 'Current Scenario'}">'line.currentQS.quantities[0]'</c:when>
        <c:otherwise>
       </c:otherwise>
       </c:choose>
        '}'
        type="number"  maxIntegerDigits='10' minFractionDigits='0' maxFractionDigits='2' groupingUsed='true' /></td>   

Hello all Im trying to do a series of when checks to concat two numbers I want to subtract and format. Is this possible or there an alternative? I get that error in the title. Thanks

        <td><fmt:formatNumber value='${'
        <c:choose>
        <c:when test="${columnB == 'MWS'}">'line.initialQS.quantities[0]'</c:when> 
        <c:when test="${columnB == 'SMC Unfunded'}">'line.expectedUnfundedQS.quantities[0]'</c:when>
        <c:when test="${columnB == 'SMC Funded'}">'line.expectedFundedQS.quantities[0]'</c:when>
        <c:when test="${columnB == 'MMC'}">'line.targetQS.quantities[0]'</c:when>
        <c:when test="${columnB == 'Current Scenario'}">'line.currentQS.quantities[0]'</c:when>
        <c:otherwise>
           </c:otherwise>
           </c:choose>
        ' - '
        <c:choose>
        <c:when test="${columnA == 'MWS'}">'line.initialQS.quantities[0]'</c:when> 
        <c:when test="${columnA == 'SMC Unfunded'}">'line.expectedUnfundedQS.quantities[0]'</c:when>
        <c:when test="${columnA == 'SMC Funded'}">'line.expectedFundedQS.quantities[0]'</c:when>
        <c:when test="${columnA == 'MMC'}">'line.targetQS.quantities[0]'</c:when>
        <c:when test="${columnA == 'Current Scenario'}">'line.currentQS.quantities[0]'</c:when>
        <c:otherwise>
       </c:otherwise>
       </c:choose>
        '}'
        type="number"  maxIntegerDigits='10' minFractionDigits='0' maxFractionDigits='2' groupingUsed='true' /></td>   

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故笙诉离歌 2025-01-04 17:26:32

为值定义变量:

...
<c:when test="${columnB == 'MWS'}">
    <c:set var="bValue" value="${line.initialQS.quantities[0]}" />
</c:when>
...

然后进行计算或格式化:

<fmt:formatNumber value="${bValue - aValue}" type="number" maxIntegerDigits="10" minFractionDigits="0" maxFractionDigits="2" groupingUsed="true" />

Define variables for the values:

...
<c:when test="${columnB == 'MWS'}">
    <c:set var="bValue" value="${line.initialQS.quantities[0]}" />
</c:when>
...

Then do your calculations or formatting:

<fmt:formatNumber value="${bValue - aValue}" type="number" maxIntegerDigits="10" minFractionDigits="0" maxFractionDigits="2" groupingUsed="true" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文