opengovsg / FormSG

Form builder for the Singapore Government
https://form.gov.sg
Other
274 stars 84 forks source link

Long string of numbers will output incorrectly in Excel #4893

Open kennethchangOPENGOV opened 2 years ago

kennethchangOPENGOV commented 2 years ago

To Reproduce Steps to reproduce the behavior:

  1. Create a FormSG short text field
  2. Collect responses that involve long string of numbers (e.g. credit card)
  3. Export as CSV
  4. Open in Excel

Expected behavior Expected behavior is that the long string of numbers should be exported correctly, but in reality, the back numbers change to 0 when opened in Excel. Opening in text editors and Apple's Numbers is fine.

kennethchangOPENGOV commented 2 years ago

This can apply to Credit Card numbers, etc.

wanlingt commented 2 years ago

Reason is because Excel reads the string of numbers as a number, and this number might exceed the maximum number that can be stored by Excel (documentation here)