Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Setting decimal place on a report field

Hello,

I am using Crystal 10 and I have embedded sub-reports that contain fields/formulas that display 6 decimal places on my report. I've attempted to use the TOTEXT({OEORDD.UNITPRICE},2) formula but am having issues. Here is what my formula does now

        // Price by Quantity and No Detail Discount

        // Print the Unit Price

        //TOTEXT({OEORDD.UNITPRICE}, {OEORDD.UNITPRCDEC})

TOTEXT({OEORDD.UNITPRICE},2)

    ELSE

        IF {OEORDD.QTYORDERED} <> 0 THEN

            ToText((({OEORDD.EXTINVMISC} - {OEORDD.INVDISC}) /

                     {OEORDD.QTYORDERED}), {OEORDD.UNITPRCDEC})

        ELSE

            ""

ELSE

    ""

Currently all output is :48.000000  I'd like it to only show 2 decimal places = 48.00

Tags:
replied

Change it to:

IF {OEORDD.LINETYPE}=1 THEN

    IF {OEORDD.PRPRICEBY} = 1 AND

        {OEORDD.INVDISC} = 0 THEN

        // Price by Quantity and No Detail Discount

        // Print the Unit Price

        TOTEXT({OEORDD.UNITPRICE}, 2)

    ELSE

        IF {OEORDD.QTYORDERED} <> 0 THEN

            ToText((({OEORDD.EXTINVMISC} - {OEORDD.INVDISC}) /

                     {OEORDD.QTYORDERED}),2)

        ELSE

            ""

ELSE

    ""

-Abhilash

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question