how to remove decimal place in crystal report

user906989 picture user906989 · Nov 24, 2011 · Viewed 7.7k times · Source

i want to return a text or a number based on a field value in crystal report

local numberVar i;
i:=Roundup(({@a}/{@b})*100,0);
if{@a}=0 then ToText('N/A') else ToText(i);

the result is always this in crystal report

  1. test_colum
    • N/A
    • N/a
    • 2.00
    • 3.00

since the integer value is converted to text using ToText() the integer results are appended with .00

Answer

user786988 picture user786988 · Nov 24, 2011

ToText (x, y) where y is a whole number indicating the number of decimal places to carry the value in x to.

http://publib.boulder.ibm.com/infocenter/radhelp/v7r5/index.jsp?topic=%2Fcom.businessobjects.integration.eclipse.designer.doc%2Fhtml%2Ftopic629.html