Optimizing Backend Currency Formatting in Data Handling with Xano and Javascript

In this meeting, the State Changers discussed how to handle product pricing data and the best approach for formatting. The focus of the conversation was about using Lambda functions and JavaScript to handle this data processing in the back end, rather than on the front end for better performance.


The problem at hand was how to correctly format the subscription prices obtained from a Paddle account, adding the appropriate currency symbol and comma separator for amounts over a thousand. The meeting pursued a learning-by-doing approach. The team tackled how to manipulate and update variables within the JavaScript editor to handle the formatting changes throughout multiple pricing points (net, gross, and tax). The adopted approach focused on speed, simplicity, and performance; and involved centralizing the formatting in the backend through the use of a Lambda function. They explored avoiding multiple iterations and function calls, making fewer trips to JavaScript land, and utilizing JS's high-speed processing capabilities in favor of optimal performance. They then talked about marshalling data between Xano and JavaScript, highlighting the fixed 'trip' cost of each data transition between these two environments. Finally, they concluded that at this stage, it was more important to have a working solution and performance optimization rather than striving to make the solution aesthetically pleasing. The session was educational, equipping them to handle similar challenges moving forward with a better understanding of back-end data processing using JavaScript and Lambda functions.


(Source: Office Hours 8/2/2023 )

State Change Members Can View The Video Here
chris-montgomery-smgTvepind4-unsplash.jpg

View This Video Now

Join State Change Risk-Free