0

So I got why to fixed returns a String, with this in mind is it possible to cast the "NaN" string into NaN to keep the following expression workable?

var numberWithPrecission = (1*"A").ToFixed(2) || 0; 
Community
  • 1
  • 1
Jonathan DS
  • 2,050
  • 5
  • 25
  • 48

1 Answers1

0

As suggested:

var numberWithPrecission = (1*"A" || 0).toFixed(2); 
Jonathan DS
  • 2,050
  • 5
  • 25
  • 48