How to format a negative number with parentheses on Node.JS? It is necessary create a function?
tks
I tryed this:
VLPeriodoAnterior<0?β(β+VLPeriodo.abs().formatCurrency(ββ, β,β, β.β, 0)+β)β:VLPeriodo.formatCurrency(ββ, β,β, β.β, 0)
but, is the best way?
1 Like
Whatβs the input and whatβs the desired output?
it is a simples dmx-text, inside of one a td:
<td dmx-text="VLPeriodo<0?'('+VLPeriodo.abs().formatCurrency('', ',', '.', 0)+')':VLPeriodo.formatCurrency('', ',', '.', 0)" class="bg-light text-body-secondary text-center pointer text-lg-end" dmx-on:click="vCDReceitaDespesa.setValue(CDReceitaDespesa);vDTInicial.setValue(idMesInicial.value.toString().toDate().formatDate('dd-MM-yyyy'));vDTFinal.setValue(idMesInicial.value.toString().toDate().addMonths(1).addDays(-1).formatDate('dd-MM-yyyy'));scRelReceitasDespesas_Detalhe.load({});modal1.show()"></td>
Hehe this is making me very dizzy.
If you want help on how to format, please provide the input and the desired output.
Fore xample you want:
-23,50
to become 25.5
That way someoone can help you
From what I can make of it, he is asking how to format negetive numbers with parentesis.
Example -25.5 to (-25.5)
I could be wrong but that what I get out of it.
1 Like
-25,5 = (25,50)
1 Like
If it works, itβs fine
Alternatively, you could write a custom formatter