Zend\I18n\View\Helper\NumberFormat param to set the number of decimals #3646

wants to merge 1 commit into


None yet

5 participants


Added an param to the viewhelper to set the number of decimals.

micheh commented Feb 1, 2013

How about adding setAttribute() and setSymbol() methods, to allow setting all attributes and symbols? Ping @cgmartin

cgmartin commented Feb 1, 2013

Looking back at this filter I'm questioning it's overall value vs. just using NumberFormatter directly in the view with the custom params/attributes. Are we over-engineering this? (Probably too late to ask at this point)

Considering that CurrencyFormat helper's use case is for simplifying currency formatting and NumberFormat is for "other" numbers, is the decimal attribute all that we'd need to make NumberFormat flexible for ~90% of use-cases?

If it isn't just decimals, I'd agree with @micheh to make it relatively maintenance free by supporting all attributes and symbols (and/or text attributes).

/cc @DASPRiD


I agree with @cgmarin's considerations. @weierophinney what do you think?


It isn't just decimals -- we also have to consider other separators, such as thousands, millions, etc. as those vary from locale to locale. It looks like those are already covered though. This may be enough.

@weierophinney weierophinney added a commit that referenced this pull request Mar 11, 2013
@weierophinney weierophinney Merge branch 'feature/3646' into develop
Close #3646

Merged to the develop branch for 2.2.0.

@weierophinney weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'feature/3646' into develop 058eeff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment