I am trying to show a customer the total amount remaining after a 50% deposit plus whatever extra payments have been made.
The expression I'm using is:
= Floor(Fields.SubTotal - (Fields.SubTotal * .5) - IsNull(Fields.Payments, 0))
The field format is currency with two decimal places to account for dollars and cents. I assumed that Floor() would account for that fact and round every number down to the nearest penny. $1,350.375 would in fact become $1,350.37. Instead, Floor() is rounding to the nearest dollar and the value I get is $1,350.00. Does Floor/Ceiling take into account the format I want my number to be in? If not, why not? That seems intuitive to me but apparently it isn't to the developers who worked on those specific functions.
I end up with one field showing the deposit (50%): 1,350.38
and another field with the balance owing: 1,350.38
I realized that in the formula above, the portion (Fields.SubTotal * .5) doesn't convert this value to two decimal places (it remains 1,350.375) and so it subtracts 1,350.375 from the Subtotal (2,700.75), returning the value 1,350.375 which it then rounds up to 1,350.38 But when you add the Balance Owing to the original deposit, I always get a value that is one penny higher than the original subtotal.
Is there a way to do this correctly in the Standalone Reporter?