Resets value to 0 if it does not find any value with its currency symbol

Resets value to 0 if it does not find any value with its currency symbol

jdiaz11jdiaz11 Posts: 6Questions: 5Answers: 0
edited August 2022 in Free community support

Cordial greetings I have a problem I have a table with numeric data with monetary symbols that are dollars and soles (currency of my country), what I do is the general sum of the column depending on the monetary symbol that has, my issue is that when I filter by state and there is no value with the dollar symbol or soles brings me in general summed amount and I would like it to be the value of 0.
I tried to improve the conditional but I can't find the solution.
in this link is my executable code

https://jsbin.com/nusowad/edit?html,js,output

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I'd refactor your code to only update the HTML element at the end of the change() function, rather than on each iteration - and update both the soles and the dollar elements. That way both would get set only once, with old values being cleared.

    Colin

Sign In or Register to comment.