adamhunter/dossier — pull request #36 by RodneyTurnham (2014-06-05 19:01:19+00:00)
Title: Formatting negative money

Added test and fix. Please note that there are (probably necessary) issues with the fix.

#commafy_number still loses the negative sign for a negative number, where it calls "whole.to_i" on a string of "-0". I could have fixed the problem in that method, but then the negative sign would be to the right of the dollar sign added by #number_to_dollars ("$-0.01"), which is not what we want as a final result.

Putting the fix in #number_to_dollars gives us the "-$0.01" result that we want, but we'll have to watch out if #commafy_number is called elsewhere.