Skip to main content
deleted 2 characters in body
Source Link
a pfp with melon
  • 9.8k
  • 9
  • 42
  • 63

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = +someNumber.toFixed(2); 

However this will convert the number to a string and parse it again, which will have a significant impact on performance. If you care about performance or type safety, check the the other questionsanswers as well.

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = +someNumber.toFixed(2); 

However this will convert the number to a string and parse it again, which will have a significant impact on performance. If you care about performance or type safety, check the the other questions as well.

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = +someNumber.toFixed(2); 

However this will convert the number to a string and parse it again, which will have a significant impact on performance. If you care about performance or type safety, check the the other answers as well.

added a warning about side effects of this innocent-looking code
Source Link
a pfp with melon
  • 9.8k
  • 9
  • 42
  • 63

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = (someNumber+someNumber.toFixed(2))/1;; 

However this will convert the number to a string and parse it again, which will have a significant impact on performance. If you care about performance or type safety, check the the other questions as well.

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = (someNumber.toFixed(2))/1; 

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = +someNumber.toFixed(2); 

However this will convert the number to a string and parse it again, which will have a significant impact on performance. If you care about performance or type safety, check the the other questions as well.

deleted 24 characters in body
Source Link
Ronan Boiteau
  • 10.3k
  • 7
  • 39
  • 62

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

with...to this:

someNumber = (someNumber.toFixed(2))/1; 

Maybe could help someone!!

I've solved this problem changing this:

someNumber = someNumber.toFixed(2) 

with this:

someNumber = (someNumber.toFixed(2))/1; 

Maybe could help someone!!

I've solved this problem by changing this:

someNumber = someNumber.toFixed(2) 

...to this:

someNumber = (someNumber.toFixed(2))/1; 
Source Link
Eve juan
  • 1.9k
  • 1
  • 11
  • 4
Loading