#2562·sheetjs

Inaccurate converting big numbers.

Author: monqkimCreated Aug 30, 2018Updated Nov 7, 2024

I have an xlsx file including some big numbers below. image

After converting this file using XLSX.sheet_to_json(), the part of result data is

"B50": {
    "t": "n",
    "v": 23000000,
    "w": "23000000"
  },
  "C50": {
    "t": "n",
    "v": 32199999.999999996,
    "w": "32200000"
  },
  "D50": {
    "t": "n",
    "v": 48299999.99999999,
    "w": "48300000"
  },
  "E50": {
    "t": "n",
    "v": 77199999.99999999,
    "w": "77200000"
  },
  "F50": {
    "t": "n",
    "v": 153999999.99999997,
    "w": "154000000"
  },
  "G50": {
    "t": "n",
    "v": 337999999.99999994,
    "w": "338000000"
  },
  "H50": {
    "t": "n",
    "v": 810999999.9999999,
    "w": "811000000"
  },
  "I50": {
    "t": "n",
    "v": 2099999999.9999998,
    "w": "2100000000"
  },
  "J50": {
    "t": "n",
    "v": 5879999999.999999,
    "w": "5880000000"
  },
  "K50": {
    "t": "n",
    "v": 18799999999.999996,
    "w": "18799999999"
  },

Due to inaccurate number converting, I used to use 'w' property to make accurate result, but in "K50" cell case, 'w' property is not accurate also. (original value is 18800000000)