Search code examples
crystal-reports

Crystal Report Formula IF Then Else Remove Decimals


I would like to remove 2 digit decimals in Crystal Report formula using if then else. The way that I have tried does not help me to solve myproblem. How do I fix it ? Here is my code;

if ({purchaseorder.CUR} = "IDR")
then Truncate({purchaseorder.UPRI})

Solution

  • Right-click your number field, select Format Field, Number Tab, Customize...

    Set the following expression for the Decimals property:

    if ({purchaseorder.CUR} = "IDR") then 0 ELSE 2