Skip to content

Commit

Permalink
Allow ui-negative-number in ui-percentage-mask
Browse files Browse the repository at this point in the history
In percentage mask, analise the tag ui-negative-number e correct value
and mask
  • Loading branch information
Konageski committed Sep 26, 2016
1 parent 1aea674 commit 790f8a4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/global/percentage/percentage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ function PercentageMaskDirective($locale, $parse, PreFormatters, NumberMasks) {
var actualNumber = parseFloat(modelMask.apply(valueToFormat));

if (angular.isDefined(attrs.uiNegativeNumber)) {
var isNegative = (value[0] === '-');

isNegative = (value.slice(-1) === '-') ? !isNegative : isNegative;
var isNegative = (value.slice(-1) === '-') ? !(value[0] === '-') : (value[0] === '-');
if (isNegative) {
actualNumber *= -1;
formatedValue = '-' + formatedValue;
Expand Down

0 comments on commit 790f8a4

Please sign in to comment.