on 07-15-2015 9:24 PM
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
Hi Dell, Thank you for the response. I made an attempt to add your rounding option to the string and I went from 48.000000 to 48.000 I'm getting closer. I was wondering if the problem is in the last portion of my formula following the ELSE IF?
// Price by Quantity and No Detail Discount
// Print the Unit Price
// TOTEXT({OEORDD.UNITPRICE}, {OEORDD.UNITPRCDEC})
totext(round({OEORDD.UNITPRICE},2),2)
ELSE
IF {OEORDD.QTYORDERED} <> 0 THEN
ToText((({OEORDD.EXTINVMISC} - {OEORDD.INVDISC}) /
{OEORDD.QTYORDERED}), {OEORDD.UNITPRCDEC})
ELSE
""
ELSE
""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Abhilash Thank You for your help. I think the problem may lay in another area of the formula I applied your suggestions and the output was the same here is the entire formula and output results:
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}, {OEORDD.UNITPRCDEC})
ELSE
IF {OEORDD.QTYORDERED} <> 0 THEN
ToText((({OEORDD.EXTINVMISC} - {OEORDD.INVDISC}) /
{OEORDD.QTYORDERED}),2)
ELSE
""
ELSE
""
Results:
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
Try this:
ToText(Round({OEORDD.UNITPRICE},2), 2)
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.