-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APPSYNC_JS support for parseInt, parseFloat and Number() #303
Comments
+1
What is the proper way to convert a string to a number with APPSYNC_JS runtime? |
As a workaround I used the unary operator: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Unary_plus const test = '123';
const testNumber = +test; |
Appears to work as well. Any reason we couldnt add this to util? as a Edit - this does NOT work as expected when deployed. Amazing.
|
Note the above does not work, amazing.
|
|
I tried to convert my object keys from string to numbers, but got "The code contains one or more errors. " as a response when I tried to use
parseInt
,parseFloat
orNumber()
.The text was updated successfully, but these errors were encountered: