How to user the numric and string variable in jscode in streamlit app

dear sir

see my code and give me idea how to i use the numrinc and string variable in jscode in streamlit application thank you in advance for your help

‘‘‘

yy = 70

#if (params.value < 70) {

score_cellstyle_jscode = JsCode(“”"

        function(params) {

            if (params.value < &yy&) {

                return {

                    'color': 'white',

                    'backgroundColor': 'red'

                }

            } else if (params.value >= 90) {

                return {

                    'color': 'white',

                    'backgroundColor': 'green'

                }

            }

            return null; // Default styling

        }

    """)

‘‘‘

How to utilize the yy variable in the aforementioned code, whether numeric or string? Please provide guidance for both.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.