Change number values in custom HTML to PDF based on a selected dropdown value
I have a custom HTML section that we use to produce a PDF in pega.
I need to change the values in the PDF based on a dropdown selection. In the dropdown you select Thousands or Millions and based on that I need to change the number to reflect the choice.
For example if I have number=1 000 000 and the dropdown has millions selected. In this case I want to only show the number 1 as value.
So I want to divide the number by the chosen value, in this case millions means we divide the number by 1 000 000.
I am thinking this might be doable with javascript in my HTML section but I am not sure.