Skip to content

Conversation

@parthbulusu
Copy link

refinement.children[0].name is considered a string not a number and hence

scope.modelMin = parseFloat((((proposal * range) / 100) + (scope.min)).toFixed(scope.decimalPlaces);
is concatinating the values "parseFloat((((proposal * range) / 100)" and "(scope.min)" instead of adding them

so changed it scope.min to int before adding.

<div  range-slider show-values="true"  min="refinement.children[0].name" max="refinement.children[refinement.children.length-1].name" model-min="vm.selPubYearRange.min" model-max="vm.selPubYearRange.max" ></div>

refinement.children[0].name is considered a string not a number and hence

scope.modelMin = parseFloat((((proposal * range) / 100) + (scope.min)).toFixed(scope.decimalPlaces);
is concatinating the values "parseFloat((((proposal * range) / 100)" and "(scope.min)" instead of adding them

so changed it scope.min to int before adding.
@danielcrisp
Copy link
Owner

What if scope.min is not an integer...?

Wouldn't parseFloat be better?

Do we also need to apply the same change to modelMax?

@parthbulusu
Copy link
Author

You are right it should be parseFloat :-).

modelMax is not causing any problems, may be because there is no arithmetic
expression based on in.

However as the code is definitely expecting these variables to be float, I
think if we parse all these to floats around line 285, that should take
care of this kind of issues for the future.

On Mon, Nov 24, 2014 at 4:40 AM, danielcrisp [email protected]
wrote:

What if scope.min is not an integer...?

Wouldn't parseFloat be better?

Do we also need to apply the same change to modelMax?


Reply to this email directly or view it on GitHub
#40 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants