I want to format the currency value in terms of comma & decimal in expression.
ex: 1234.556 will be 1,234.56
1234.556
1,234.56
Thanks in Advance
Hey assif_tiger,
You can use the build-in FormatCurrency() function for that.
Documentation: https://success.outsystems.com/Documentation/10/Reference/Logic/Built-in_Functions/Format_Built-in_Functions#FormatCurrency
Regards,
Sam
Yes it is easy for expression you can do as Sam said above...but for input form it would be trickier....Just share my experience on this....
You can use help 1 extra variable and use of custom mask component.
Bind custom mask to this 1 variable and make this variable as variable for input widget.
Then don't forget to convert to necessary format when you do save action
Hi @Eric Halim! What's a custom mask component, if you could please elaborate
Hello,
On an expression, you can use the system function 'FormatDecimal' where you can set the number of decimal places, the thousands separator character, and the decimal separator character.
FormatDecimal(TextToDecimal("1234.556"),2,".",",")
On Inputs, for web applications, you can use the forge component Custom Masks and for mobile applications, you can use forge component Input Masks Mobile.
Hope it helps.
DO
Hi,
Please use mask input for mentioned requirement.
Thanks!
To expand on this question..what if 123456 to $1234.56
Thank you,
FrankCLT
Hello FrankCLT,
You can use the built-in action FormatCurrency to do that. Please see the documentation here.
Note: I think you should create a new post because your question is different from the original post in 2018.
BR,
Luis
FrankCLT wrote: