You'll either need to use an "as is" formated calculation field that uses IF or Case to check the value of Code to determine the number of places or you'll need to stack two copies of Value on top of each other, format each two use different numbers of decimal places and use the Hide Object When setting in the Inspector's data tab to always hide one or the other as determined by the value of "code".
Case ( Code = 1020 ; Round ( Value ; 0 ) ; Round ( Value ; 2 ) )
HWO for one copy: YourTable::Code = 1020 // format to two places
for 2nd copy: YourTable::code <> 1020 // Format to whole number
Phil! Long time no see
I'm using a couple of Case statements in there at the moment yes, and I'm stacked with two fields already, one for percent, one for a value. It's just now we need another type of value - whole numbers only. It sounds like we're thinking along the same lines.
I will then have another 5 or so to go as it's a landscape report covering lots of other calculations against the Codes 1020 etc
you might add a number field to your Codes table that describes how many digit to round to for reporting.
Since it's apparent that these "numbers" actually represent different quantities (dollars, months, etc.) and therefore probably can't meaningfully be used in a calculation, have you considered using a calculated text field instead? Then you can format them pretty much any way you want.