How I can to do a binding transformer with @expr data in google app maker? The Next CEO of Stack OverflowGoogle App Maker app not working after deployGoogle App maker debuggingGoogle App maker list view filteringGoogle App maker dropdown null item nameHow can I link my spread sheets to App Maker?Google App Maker Table object only displays Date not DateTimeCreate Table in Google Docs with App MakerGoogle app maker: How to list existent groups?Google App Maker: Enable app to make Admin SDK API callsSave Url of email sent by google app maker

Is "for causing autism in X" grammatical?

Won the lottery - how do I keep the money?

What is the result of assigning to std::vector<T>::begin()?

Why am I allowed to create multiple unique pointers from a single object?

Sending manuscript to multiple publishers

How to add tiny 0.5A 120V load to very remote split phase 240v 3 wire well house

How do I transpose the 1st and -1th levels of an arbitrarily nested array?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

How to solve a differential equation with a term to a power?

multiple labels for a single equation

What benefits would be gained by using human laborers instead of drones in deep sea mining?

If the heap is initialized for security, then why is the stack uninitialized?

Why has the US not been more assertive in confronting Russia in recent years?

Do I need to enable Dev Hub in my PROD Org?

Rotate a column

How to count occurrences of text in a file?

Is it professional to write unrelated content in an almost-empty email?

What connection does MS Office have to Netscape Navigator?

If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?

How to start emacs in "nothing" mode (`fundamental-mode`)

What flight has the highest ratio of time difference to flight time?

Is there a way to save my career from absolute disaster?

Is there a difference between "Fahrstuhl" and "Aufzug"

Anatomically Correct Strange Women In Ponds Distributing Swords



How I can to do a binding transformer with @expr data in google app maker?



The Next CEO of Stack OverflowGoogle App Maker app not working after deployGoogle App maker debuggingGoogle App maker list view filteringGoogle App maker dropdown null item nameHow can I link my spread sheets to App Maker?Google App Maker Table object only displays Date not DateTimeCreate Table in Google Docs with App MakerGoogle app maker: How to list existent groups?Google App Maker: Enable app to make Admin SDK API callsSave Url of email sent by google app maker










0















I have a TABLE in google app maker, with two numbers, and a result: result= number1/number2



Number1 value is datasource.item.Number1#formatNumber('#.00')



Number2 value is datasource.item.Number2#formatNumber('#.00')



The result is (@datasource.item.Number1/@datasource.item.Number2)#formatNumber('#.00')



But , when I run this app, I have this error:




Syntax Error: Unterminated statement at return
(_arg0/_arg1)#formatNumber('#.00')




I want that result to show in the table but with only 2 decimals.



How I can to do that?










share|improve this question




























    0















    I have a TABLE in google app maker, with two numbers, and a result: result= number1/number2



    Number1 value is datasource.item.Number1#formatNumber('#.00')



    Number2 value is datasource.item.Number2#formatNumber('#.00')



    The result is (@datasource.item.Number1/@datasource.item.Number2)#formatNumber('#.00')



    But , when I run this app, I have this error:




    Syntax Error: Unterminated statement at return
    (_arg0/_arg1)#formatNumber('#.00')




    I want that result to show in the table but with only 2 decimals.



    How I can to do that?










    share|improve this question


























      0












      0








      0








      I have a TABLE in google app maker, with two numbers, and a result: result= number1/number2



      Number1 value is datasource.item.Number1#formatNumber('#.00')



      Number2 value is datasource.item.Number2#formatNumber('#.00')



      The result is (@datasource.item.Number1/@datasource.item.Number2)#formatNumber('#.00')



      But , when I run this app, I have this error:




      Syntax Error: Unterminated statement at return
      (_arg0/_arg1)#formatNumber('#.00')




      I want that result to show in the table but with only 2 decimals.



      How I can to do that?










      share|improve this question
















      I have a TABLE in google app maker, with two numbers, and a result: result= number1/number2



      Number1 value is datasource.item.Number1#formatNumber('#.00')



      Number2 value is datasource.item.Number2#formatNumber('#.00')



      The result is (@datasource.item.Number1/@datasource.item.Number2)#formatNumber('#.00')



      But , when I run this app, I have this error:




      Syntax Error: Unterminated statement at return
      (_arg0/_arg1)#formatNumber('#.00')




      I want that result to show in the table but with only 2 decimals.



      How I can to do that?







      google-app-maker






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 21 at 17:10









      Morfinismo

      2,5301820




      2,5301820










      asked Mar 21 at 15:29









      Leibin AriasLeibin Arias

      61




      61






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Let's first understand the reason behind the error. In Javascript, there is an operator called the ternary operator.




          The conditional (ternary) operator is the only JavaScript operator
          that takes three operands. This operator is frequently used as a
          shortcut for the if statement.




          AppMaker thinks that you are putting a ternary operator and is trying to hint you that the syntax is not correct, hence you see that error.



          Now that we've understand the error, let's focus on your need. So you want to use a binding transformer to format the result value to show two decimals only. The problem with the #formatNumber binding transformer is that it expects a primitive value double and you are providing an expression that evaluates to a number, which is not the same thing.



          Fortunately, javascript have some built in methods that can help you achieve this. For this case, I'd go with toFixed() method.




          The toFixed() method formats a number using fixed-point notation.




          So all you have to do is change your binding expression to the following:



          (@datasource.item.valueOne/@datasource.item.valueTwo).toFixed(2)





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283966%2fhow-i-can-to-do-a-binding-transformer-with-expr-data-in-google-app-maker%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Let's first understand the reason behind the error. In Javascript, there is an operator called the ternary operator.




            The conditional (ternary) operator is the only JavaScript operator
            that takes three operands. This operator is frequently used as a
            shortcut for the if statement.




            AppMaker thinks that you are putting a ternary operator and is trying to hint you that the syntax is not correct, hence you see that error.



            Now that we've understand the error, let's focus on your need. So you want to use a binding transformer to format the result value to show two decimals only. The problem with the #formatNumber binding transformer is that it expects a primitive value double and you are providing an expression that evaluates to a number, which is not the same thing.



            Fortunately, javascript have some built in methods that can help you achieve this. For this case, I'd go with toFixed() method.




            The toFixed() method formats a number using fixed-point notation.




            So all you have to do is change your binding expression to the following:



            (@datasource.item.valueOne/@datasource.item.valueTwo).toFixed(2)





            share|improve this answer



























              0














              Let's first understand the reason behind the error. In Javascript, there is an operator called the ternary operator.




              The conditional (ternary) operator is the only JavaScript operator
              that takes three operands. This operator is frequently used as a
              shortcut for the if statement.




              AppMaker thinks that you are putting a ternary operator and is trying to hint you that the syntax is not correct, hence you see that error.



              Now that we've understand the error, let's focus on your need. So you want to use a binding transformer to format the result value to show two decimals only. The problem with the #formatNumber binding transformer is that it expects a primitive value double and you are providing an expression that evaluates to a number, which is not the same thing.



              Fortunately, javascript have some built in methods that can help you achieve this. For this case, I'd go with toFixed() method.




              The toFixed() method formats a number using fixed-point notation.




              So all you have to do is change your binding expression to the following:



              (@datasource.item.valueOne/@datasource.item.valueTwo).toFixed(2)





              share|improve this answer

























                0












                0








                0







                Let's first understand the reason behind the error. In Javascript, there is an operator called the ternary operator.




                The conditional (ternary) operator is the only JavaScript operator
                that takes three operands. This operator is frequently used as a
                shortcut for the if statement.




                AppMaker thinks that you are putting a ternary operator and is trying to hint you that the syntax is not correct, hence you see that error.



                Now that we've understand the error, let's focus on your need. So you want to use a binding transformer to format the result value to show two decimals only. The problem with the #formatNumber binding transformer is that it expects a primitive value double and you are providing an expression that evaluates to a number, which is not the same thing.



                Fortunately, javascript have some built in methods that can help you achieve this. For this case, I'd go with toFixed() method.




                The toFixed() method formats a number using fixed-point notation.




                So all you have to do is change your binding expression to the following:



                (@datasource.item.valueOne/@datasource.item.valueTwo).toFixed(2)





                share|improve this answer













                Let's first understand the reason behind the error. In Javascript, there is an operator called the ternary operator.




                The conditional (ternary) operator is the only JavaScript operator
                that takes three operands. This operator is frequently used as a
                shortcut for the if statement.




                AppMaker thinks that you are putting a ternary operator and is trying to hint you that the syntax is not correct, hence you see that error.



                Now that we've understand the error, let's focus on your need. So you want to use a binding transformer to format the result value to show two decimals only. The problem with the #formatNumber binding transformer is that it expects a primitive value double and you are providing an expression that evaluates to a number, which is not the same thing.



                Fortunately, javascript have some built in methods that can help you achieve this. For this case, I'd go with toFixed() method.




                The toFixed() method formats a number using fixed-point notation.




                So all you have to do is change your binding expression to the following:



                (@datasource.item.valueOne/@datasource.item.valueTwo).toFixed(2)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 21 at 17:33









                MorfinismoMorfinismo

                2,5301820




                2,5301820





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55283966%2fhow-i-can-to-do-a-binding-transformer-with-expr-data-in-google-app-maker%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript