Currency formatting in Mendia

0
We were advised by Mendix support to use Text widget to display decimal attribute with a $ sign followed by a parameter (${1}) in order to display decimal field as currency field on UI. That is workable solution until you come across a negative value. For e.g., -1000.00 would appear as $-1000.00, which is absurd. Upon asking further for a better solution, I was advised to ask in forums. I know there are some widgets available, but I believe this is a very common requirement in an application and Mendix should incorporate this within the modeler. Also, I know I can write a microflow for a calculated field to address this issue, but again not sure how much oof performance hit is involved if we keep on adding calculated fields to a mendix application.   Anyway, let me know if there is a possible workaround for this problem.
asked
2 answers
1

Stackoverflow to the rescue. You can do it with a bit of CSS and Javascript: https://stackoverflow.com/questions/9372624/formatting-a-number-as-currency-using-css

But indeed the platform support for currency could be improved.

Regards,

Ronald

[edit]

.enMoney::before {
    content:"$";
}
.negMoney {
    color:red;
}

[edit]

Other sollution would be to use the token replacer from the model reflection. There you can set a display pattern with different pattern for negative values.

answered
0

What would you expect the output to be?

Would the Group Digits option in Text Box help? https://docs.mendix.com/refguide/text-box#group-digits

answered