search

Home  >  Q&A  >  body text

javascript - js reads a value in one of the excel columns as 0.3556 but reads 0.35559999999999997?

js reads a value in one of the excel columns as 0.3556, but the read value is 0.35559999999999997. But if you delete 0.3556 manually and write it in manually, it will be fine. Why is this?

PHP中文网PHP中文网2707 days ago1115

reply all(3)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-07-05 11:03:05

    You can directly enter 0.3556 and it will be normal. This may be a good thing. Microsoft has rounded up 0.35559999999999997 and displayed it as 0.3556.


    Microsoft may be based on the following considerations:

    1. If the difference between the two numbers a and b is very small, then a can be considered equal to b.

    2. It doesn’t look good when there are many decimals

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-07-05 11:03:05

    I remember there is a setting in Excel that allows you to specify the number of decimal places for a cell. It may be that this setting hides the subsequent digits.

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-07-05 11:03:05

    It is estimated that in excel, this column of numbers has a higher precision, and it may be of long type. JS indicates that there is a problem with long type numbers

    reply
    0
  • Cancelreply