0

Is there a way to get JS to not round a number with a 0 decimal to a whole number? ex var = 100.0 //100? I know this isn't a regular thing to do in JS but it's needed to port a method from a processing library which im porting to processing.js. the method uses strict typed floats/ints to decided whether its a float or int/color value.

thanks

Jisike
  • 383
  • 1
  • 3
  • 11

1 Answers1

0

There is no integer in JavaScript, there are only floats. So trying to figure out if it is an int or float is basically impossible.

epascarello
  • 204,599
  • 20
  • 195
  • 236