see if this works for you...it seems wrong to me but gave me good results on a small test sample.
a little modification....change the divide to subtract, instead of =1, now is <>0, and explicitly defined the # of decimals for each instance.
if {totAmount} >1 then
if {totAmount} - truncate({totAmount}) <> 0 then totext({totAmount},2)
else totext({totAmount},0)
else
totext({totAmount},2)