Iwark / spreadsheet

Google Go (golang) library for reading and writing spreadsheet files on Google Docs.
MIT License
382 stars 53 forks source link

fix(bug): Fixes bug when infinite and NaN floats are mistakenly treated as numberValues #61

Closed greencoda closed 1 year ago

greencoda commented 1 year ago

This PR proposes to fix an edge-case when the contents that would be written into the cells match any of the special cases when parsing a float value and would categorised as numberValue:

"Inf", "+Inf", "-Inf", "Infinity", "+Infinity", "-Infinity" and "NaN" (all case-insensitive)

And would run into an exception by Google Sheets API:

error status: INVALID_ARGUMENT, code:400, message: Invalid value at 'requests[27311].update_cells.rows[0].values[0].user_entered_value.number_value' (TYPE_DOUBLE), "Inf"

Iwark commented 1 year ago

Great, thanks!