I am trying to round numbers using the code below, which does round the number to 9M
if the number has decimals 9,000,000.55
, but if the number is 9,000,000
it does not round. How to get around this? many thanks in advance.
SWITCH(
TRUE(),
_sales >= 1000000, FORMAT( _sales, "$#,##0,,M"),
_sales >= 1000, FORMAT( _sales, "$#,##0,k"),
FORMAT( _sales, "$#,##0" )
)
EDIT
Here you go.
Column = SWITCH(
TRUE(),
ABS([_sales]) >= 1000000, FORMAT( [_sales], "$#,##0,,M"),
ABS([_sales]) >= 1000, FORMAT( [_sales], "$#,##0,k"),
FORMAT( [_sales], "$#,##0" )
)
The code works fine as far as I can see.