uhlryk / angular-dynamic-number

Highly customizable angular directive for numbers
64 stars 32 forks source link

Min and Max decimal places #44

Open Red-3 opened 7 years ago

Red-3 commented 7 years ago

We have a requirement to show at least 2dp and a maximum of 6dp.

So a model value having < 2dp would show with exactly 2dp. (An integer 123 would be shown as 123.00 for example.) A model value having 4 dp precision would be shown with exactly 4dp. A model value having >= 6dp would show exactly 6dp with given rounding strategy.

(I would hope it would be something like setting numFract: 6 and numFixed: 2, but numFixed is a boolean, not number of dps.)

So as far as I can tell, there is no way to configure AWNUM's formatter to do this? If there is a way, please let me know. If not please take this as a feature request.

uhlryk commented 7 years ago

It looks useful. I will set this as feature and implement later.