Format parameter in text widget

0
Hi all, I have a text widget including a parameter. Example: Cost: {1} {1} is a decimal field   When I run this, I get something like: Cost: 32250,4034   However, I would like to get Cost: 32.250,40    Any suggestions?  
asked
4 answers
0

Tim, agreed it would be best if we could format within a Text widget. Unfortunately I don't believe it's possible at this time. Instead I use:

  • a Text widget for static text before my field
  • then an input widget set to read-only and display as text
  • another Text widget (if necessary to complete my string

 

If you set the following style on all three of these widgets, they'll render inline as one sentence:

  • display: inline;
answered
0

I dont know the way to do it directly, it would be nice if a parameter could take form of microflow call with string as result.

I suggest you add dummy calculted attribute to your entity, that can them do any task

answered
0

The FormatString widget allows you to format a decimal number.

If you add your "cost" attribute and name it e.g. cost 

then you can use a display string like e.g.: Cost: ${cost}

answered
0

In my opinion you can not use the FormatString widget because you need the format decimal function (https://docs.mendix.com/refguide6/Parse+and+format+decimal+function+calls) to round the decimal to the number of decimals you want. In the text widget you can not use this function (allthough it would be a nice enhancement if we could).

The widget that you should be using is the Custom String widget  https://appstore.home.mendix.com/link/app/1426/Mendix/CustomString Because in that widget a microflow can be used to create the string to return.

Regards,

Ronald

 

answered