0

I have number value returning from my backend but it my knob it return as NaN and I've searched this website and googled it but all I got was the way to test if my value isNaN or not, which is not.

Code

console.log('As of String: ', data.inProgress.toString());
console.log('As of Number: ', data.inProgress);
if (isNaN(data.inProgress)) {
  console.log('Not a Number!');
} else {
  console.log('Is a Number!');
}

Result

one

Usage

$('#knobProgress')
  .val(data.inProgress)
  .trigger(
    'configure',
    {
      "min":0,
      "max":data.total,  //2
    }
);

Update

If I comment trigger part from my code it works just fine, whatever the issue is, is coming from trigger part.

This works

$('#knobProgress')
.val(data.inProgress);
// .trigger(
//     'configure',
//     {
//         "min":0,
//         "max":data.total,  //2
//     }
// );
E_net4
  • 27,810
  • 13
  • 101
  • 139
mafortis
  • 6,750
  • 23
  • 130
  • 288

1 Answers1

1

isNaN is used to test the NaN itself,only isNaN(NaN) return true

Kylexii
  • 11
  • 2