4

I have a series of JS calculations that show Infinity depending on user choices. How does one stop the value Infinity appearing and, for example, show 0.0 instead?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501

1 Answers1

15

How about this:

value = isFinite(value) ? value : 0.0;
raina77ow
  • 103,633
  • 15
  • 192
  • 229