djangosnippets.org: Latest snippets posted by pkshiuhttps://djangosnippets.org/users/pkshiu/2009-04-16T19:30:58.074362-05:00pkshiuTemplate filter for formatting negative numbers
2009-04-16T19:30:58.074362-05:00pkshiuhttps://djangosnippets.org/snippets/1447/<p>I have a need to conditionally format a negative number, a hedgefund's daily price change, Excel style. i.e. show a negative number as a parenthesized number instead of a negative sign. Here is a filter that will do that and more, solving a more general case. See the doctest for …</p>
Freely redistributable