4 Replies Latest reply on Oct 5, 2016 9:16 AM by Mike_Mitchell

    Use a formula to remove 2dp from a 2dp formatted cell


      I have a situation where I have a field calculating a value and depending on the record I need this value to be either 0 decimal places or 2 decimal places.


      See below - How can I have Codes 1000 and 1010 reported to 2DP and code 1020 report to 0DP in the same field?


      The data set is pretty simple, as follows:


      Code     Description           Value

      1000     Blue Things          10.00

      1010     Red Things           25.00

      1020     Months in range     6


      So when I report on this I'd get:


      Blue things     10.00

      Red things      25.00

      Months           6


      However, because of the on report formatting (inspector) of the field, I get this:


      Blue things     10.00

      Red things      25.00

      Months           6.00


      6.00 months is not sensible for the report I'm writing and I don't want to write a second field which would be returning only Code 1020 and then format that to 0 decimal places.


      I've tried to use truncate and this removes other decimals I have, but replaces them with zeros (I'd guess because of the field on report formatting from the inspector).