After searching for scripts to format currency in Portuguese, I came across several options that were tailored for ENG/US currency. Adapting them to meet my needs proved to be quite challenging.
Even when attempting to modify a script myself, I encountered difficulties.
Finally, when I found a script online that seemed promising, it failed to work properly. An error message popped up:
Uncaught SyntaxError: Unexpected identifier : lin23
<script>
function number_format(a, b, c, d) {
// Function code here
}
function ValorPorExtenso(valor) {
// Function code here
}
alert(ValorPorExtenso(8916165));
</script>