Hacker News new | ask | show | jobs
by fakedang 642 days ago
I prefer the system implemented at most banks and investment firms (maybe because it's so ingrained in me). Just use brackets!!

Sure, negative signs are accurate but for some numbers which can be both positive and negative, my brain kinda goes into a short thinking loop of "is that really a minus?". With brackets (which are the SEC standard), my brain doesn't tend to overthink in that direction.

1 comments

I supported those parentheses in the TXR Lisp pic macro:

  1> (pic "##.#" 42)
  "42.0"
  2> (pic "(##.#)" 42)
  " 42.0 "
  3> (pic "(##.#)" -42)
  "(42.0)"
The ### notation, may be imediately preceded by a parens, which must be matched by a closing one. Both parentheses become spaces for a non-negative value, or are rendered for a negative one.

The notation is mutually exlusive with the + for requesting an explicit positive sign:

  4> (pic "(+#.#)" -42)
  "(-42.0)"
  5> (pic "(+#.#)" 42)
  "(+42.0)"
:)

The parens have become just literal text.