Hiding Decimals When You Don’t Need Them

Often, salary range structures will include both hourly and annual rates, and for reporting purposes, you may want to include the decimals for the hourly rates, but not for the annual rates.  This is a method that I personally use when creating reports showing our salary ranges.  You can use this formatting code to hide the decimals for annual rates, and still show it for hourly rates:

=Format([YOUR_VARIABLE],IIf([YOUR_VARIABLE]>1000,"$0,000", "$0.00"))

In this instance, above, I am stating that if my variable is greater than 1,000, do not show decimals.  That is represented with this format: ” $0,000″.   The hourly format follows the annual rate, and is represented as “$0.00”.  Notice that I included the dollar sign and the comma, because if I did not, they would be omitted.

In a practical application, the formula might look like this:

=Format([Salary_Range_Minimum],IIf([Salary_Range_Minimum]>1000,"$0,000", "$0.00"))