Closed semprom closed 10 years ago
'80' is a string, while 50 is a number. Internally, the contrast method is doing:
('80' + 100) / 100
which does string concatenation first, and then converts to an integer when division is attempted. If you don't have control over your input data, run parseInt()
on it before passing it to CamanJS.
Why when I do this this.contrast(50); it works and when I do this contr = '80'; this.contrast(contr); it doesn't work? When contr is '80' it doesn't work. When its 80 it works.
Very strange ...
Thanks.