josscrowcroft/accounting.js — Issue #30: Unformat makes bracket-notation negatives become positives
Author: josscrowcroft
Created: 2011-10-18 05:24:00+00:00
State: open
Labels: bug

Not so much a 'bug' as a 'huh?'

If you're formatting negative values with brackets, which is common in financial and accounting scenarios, `accounting.unformat` should recognise them. Currently:

```
accounting.unformat( "GBP (53,180.08)" ) // 5318008 (should be -5318008)
```

But this could definitely get confusing for people if not done properly and requires a pretty solid regular expression and good documentation, otherwise it'll become one of those things that people constantly say "Hey man wtf" because they weren't aware of that behaviour.