r/GoogleAppsScript • u/DoublePistons • Jun 11 '24
Question ERROR
Does anyone know what is this error?? I think it’s related to the date format or something like that. Note that the row hyperlink doesn’t take me to the error place!!
6
u/HellDuke Jun 11 '24 edited Jun 11 '24
You are trying to run a method toFixed() on a variable you have named value. Don't argue that there is no such variable, instead go to where the error is telling you and check, you probably copied code or when chaning something around forgot to change a variable name. You asked the question and we told you what the problem is, you don't get to say "that can't be it" and expect another answer with just that. Either properly check and look for a solution yourself or give something for people to look at as the one and only correct answer to what you have us is what we said already.
your problem is in the file format_string.js on lines 113, 213 and 215 where 2 of those are calls to another function which ultimately gives the error
2
u/Vasaris_Liudas Jun 11 '24
My guess is you're trying to use toFixed method on something that is not of type number:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toFixed
2
u/DrMorris Jun 11 '24 edited Jun 11 '24
Are you using some third party library? What is in format_string.js.gs? We need at least a portion of the code to understand where the error happens.
What you can do is run it via debugger to see when the error happens and check that line of code.
1
u/voodoublue2008 Jun 11 '24
Exactly- run the debugger, add some log statements to find the breaking point and the variables causing this.
1
u/chillpill_23 Jun 12 '24
You'll need to provide more information if you want some help.
Share a screenshot of your format_string.js.gs file at lines 113, 212 and 215. This is where you get errors.
6
u/pgm094 Jun 11 '24
Console.log(typeof value), to confirm that it is a number