I want to put a negative sign before the dollar sign, For example, the below output is positive:
paste0("$ ",formatC(2344, format="f", digits=2, big.mark=","))
[1] "$ 2,344.00"
However, if the number is negative, dollar symbol will come before that:
paste0("$ ",formatC(-2344, format="f", digits=2, big.mark=","))
[1] "$ -2,344.00"
But I want the output as:
> paste0("$ ",formatC(-2344, format="f", digits=2, big.mark=","))
[1] "- $ 2,344.00"