bcmyers / num-format

A Rust crate for producing string representations of numbers, formatted according to international standards
Apache License 2.0
122 stars 22 forks source link

Accounting style negatives #17

Open Deedasmi opened 5 years ago

Deedasmi commented 5 years ago

I think this crate is great, and it massively simplifies some logic in my project while being much faster at it. But I’m working with financial data, where -$50 should be displayed $(50). The currency symbol is out of scope here of course.

I see the custom builder can specify a negative sign, but I don’t see a way to easily place the parentheses at the end.

I’m on mobile and just found this via week in Rust, so apologies if I missed it.

bcmyers commented 5 years ago

Thanks! Accounting style (including the currency symbol) is something I'd like to eventually build functionality for, but it will probably take a lot of work. I think it's out-of-scope for me at least in the near-term, but longer-term I'd like to tackle it. Let's use this issue to track updates / progress.

bcmyers commented 5 years ago

Related to #7.

Deedasmi commented 5 years ago

I’d say that currency information should be a separate crate built on top of this one. Keep this crate clean.

I could understand if parentheses denoting negatives is also held for that other crate, but being that’s it’s consistent across locals I figured it was okay here as a builder option.