2

I read a value (in this case 7) from a Google Spreadsheet with a script, increase that value using source++ and write the increment back to the spreadsheet.

I expect a series of 7, 8, 9, 10.

Instead, I get 7, 800 000 000 000, 900 000 000 000, 100 000 000 000.

(Please note the 900 billion to 100 billion “increase.”)

source = (source+1) behaves identical.

What's going on here?

MWE: https://docs.google.com/spreadsheets/d/1I98atMSUqwsEpt_EMjbHm1sdWQg5Bgn8ABsEz-2E2wE/edit?usp=sharing

2

This is a known bug in new Sheets whereby the spreadsheet regional settings generate an incorrect output. From the entry on this duplicate issue ticket:

If regional settings are set to US then setValue/setValues works properly. If regional settings are German, Polish, Russia and possibly others then there are different results! Polish - 1.00000000000000 German - 100.000.000.000

[For Google Apps Script questions you may get a better response in Stackoverflow]

1

I've copied your sheet and ran the code; I get the same results.

However, when I create a new Spreadsheet and run the code on the new sheet, the problem disappears.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.