在查找 iby_trxn_documents 表时,我们有来自 Oracle 的摘录
Value(发票金额)是一个字符串。
示例如下:
我想要:
我们需要分割该字符串,使其成为 XX 美元和 XX 美分
我如何创建逻辑来分割它? 我在 MS Word 中使用 RTF。
任何帮助将不胜感激!
我已经尝试过:
<?xdoxslt: truncate(PaymentAmount/Value * 1)?>
<?xdofx:floor(format-number:PaymentAmount/Value;’99G999G999’?>
<?format-number:PaymentAmount/Value;’######’?>
<?truncate(format-number:PaymentAmount/Value;’999G999D99’)?>
<?round(format-number:PaymentAmount/Value;’999G999D99’)?>
<?format-number(round(100 * $number) div 100, '#.00')?>
下面的内容可以工作,但现在不行,因为没有任何“。”在上面的示例(54380)中,查询在没有小数的地方失败,因此它实际上不起作用。
<?xdofx:substr(PaymentAmount/Value,1,Instr(PaymentAmount/Value,'.',-1)-1)?>
如果您使用 XSLT,您可以执行以下操作:
<xsl:value-of select="floor(Value)"/>
<xsl:text> Dollars and </xsl:text>
<xsl:value-of select="100 * Value mod 100"/>
<xsl:text> Cents</xsl:text>
演示在这里。