0

I got a data from server like this object.

[
  {
    rawTime: '2021-12-01T14:58:21.000+0000',
    score: 5.4928278748
  },
  {
    rawTime: '2021-12-01T14:58:21.000+0000',
    score: 7.4928278748
  }
]

I want to make this object like this. Multiple all score value data with 10

[
  {
    rawTime: '2021-12-01T14:58:21.000+0000',
    score: 54.928278748
  },
  {
    rawTime: '2021-12-01T14:58:21.000+0000',
    score: 74.928278748
  }
]

And I thought it can use 'map' with this.

let processedData = itemData.data.identicalList;
processedData.forEach(function(element,index,_array){
   _array[index].score = element.score.toPrecision(5)*10;
})

And it actually works, but some values are not multiplying. And I don't know why.
Numbers that are not multiplied look like this.
How can I solve this?

7.3314e+25 %

enter image description here

writingdeveloper
  • 984
  • 2
  • 21
  • 46
  • In `7.3314e+25` e+25 means you have to do `7.3314 * 10^(+25)`. Which mean it's too large number (before the decimal point). – nikodz Feb 07 '22 at 06:55
  • You might find [this post](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript) helpful. – BobRodes Feb 07 '22 at 07:04

0 Answers0