Skip to content

Initial 0 on percentage not formatted#57

Closed
faelcorreia wants to merge 3 commits intoassisrafael:masterfrom
faelcorreia:faelcorreia-patch-1
Closed

Initial 0 on percentage not formatted#57
faelcorreia wants to merge 3 commits intoassisrafael:masterfrom
faelcorreia:faelcorreia-patch-1

Conversation

@faelcorreia
Copy link

Issue #52

@assisrafael
Copy link
Owner

I had tested your patch and found that your test pass even if your bug fix is not used.
The problem is with your model value: '0'
In JavaScript !'0' === false so this case is covered.
However, if you change your model value to 0 the directive throws an error.
The main problem is that the formatter needs to convert the number to string before trying to format it.

@assisrafael
Copy link
Owner

Take a look at the tests that I included into the develop branch: 55e1eb2

@faelcorreia
Copy link
Author

I see. Would be right to call toString on value before return it?

@assisrafael
Copy link
Owner

You had tried it?

@assisrafael
Copy link
Owner

Fixed in 5d0f456

@assisrafael assisrafael closed this Apr 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants